The program nnn is one of the lightest file managers available for Linux, macOS, BSDs. It is not your traditional file browser though as it lacks a graphical user interface.

Tip: if you are looking for a traditional file manager instead, check out File Commander.

nnn is an excellent command line based file manager for Linux, macOS and BSDs

To install it, download one of the pre-compiled binaries from the releases page. Since it is a command line interface app, fire up a terminal and type nnn to launch it. There you go, a file manager inside the terminal. I came across it in a YouTube video by Luke Smith and was intrigued by it.

Navigation

Use the up and down arrow keys to navigate up or down in the file and folder structure, and left and right arrow keys go back or forward. The Enter-key opens a folder or file, and you can use Page Up or Down to scroll up and down a directory. Use the Q key to quit the app or exit certain views.

nnn folder view

Note: Hit the ? key to view a cheat-sheet of all the keyboard shortcuts. Use the H key when in the help menu to view an explanation of the shortcuts.

nnn help

Speaking of which there are many keyboard shortcuts which use the Shift and Control key for combos. For e.g. you can use Shift + P to copy files, Ctrl + O to open with (and enter the name of the file handler program). The numbers that you see at the top can be activated by holding down the Shift-key and pressing the corresponding number on the keyboard. These work like tabs in other programs so that you may have different views open.

Selecting files

Want to select a single file? Highlight it and hit the space key. Once selected, you may perform actions on the selection such as using F2 to rename the file.  Control is used for range selection (that's the same as multi selection which you would do with Shift).

Once you're in a folder, you can access the files in it by selecting them. Since nnn lacks a previewer, it will open the files in their default handler app. But the one exception to this is text documents which it can open directly. You can edit text files by hitting e, or view them by using p.

nnn text viewer

Search for folders instantly

nnn has an as-you-type search which can be toggled with the / key. It supports regex and substring formats; the functionality provides advanced search functionality but advanced queries require that users know how to use regular expressions and the options provided by the file manager.

nnn help detailed

File Archiver

Did you know nnn can be used as a file archiver? It can open, extract and create archives. Use F to create an archive, and Ctrl + F to extract one. T opens the archive and Shift + F lists the contents of the archive.

Plugins

nnn supports plugins which greatly increase its functionality (play music, upload to imgur, view PDF, etc). You can install plugins with the command:

curl -Ls https://ift.tt/2qaIgbY | sh

nnn plugins

To access plugins use Shift + R, which displays a list of available plugins. Execute the plugin with the enter key. For e.g. if you wanted to calculate the checksum value of a file, you should select the file. Then use Shift + R, highlight the checksum plugin and enter.

I haven't scratched nnn's surface. You can do a lot more with the program, but this should hopefully get you started with the basics.

This article was partially based on the official nnn Wiki. I simplified it a bit.

Closing Words

The file manager nnn is an advanced tool that may appeal to users who use Terminal regularly the most. Its advanced capabilities may make it interesting to advanced users who need to locate specific files and folders quickly, or run actions on those. The available plugins extend the functionality of the program significantly.

Now You: What is your favorite file manager on *nix systems?

Thank you for being a Ghacks reader. The post nnn is an excellent command line based file manager for Linux, macOS and BSDs appeared first on gHacks Technology News.



Post a Comment

أحدث أقدم