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

Ashwin
Nov 1, 2019
Linux, Linux Mint, Mac
|
13

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://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs | 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?

Summary
software image
Author Rating
1star1star1star1star1star
2 based on 122 votes
Software Name
nnn
Operating System
Linux, macOS
Software Category
System
Price
Free
Landing Page
Advertisement

Previous Post: «
Next Post: «

Comments

  1. Lina Freeman said on November 24, 2019 at 5:12 pm
    Reply

    A great post! Thanks for the article!

  2. Daniel Winter said on November 2, 2019 at 4:18 pm
    Reply

    Another filemanager for the unix console is dired inside emacs.

  3. Richard said on November 2, 2019 at 9:48 am
    Reply

    This is my new favourite!

    Tons of features and incredible speed. Thanks for the article!

  4. me said on November 1, 2019 at 9:16 pm
    Reply

    The ultimate command line file manager for linux is ranger.
    It even uses vi key style commands.

    1. Nigel said on November 4, 2019 at 3:19 am
      Reply

      fff (https://github.com/dylanaraps/fff), nnn and lf (https://github.com/gokcehan/lf) also have vi style commands, and nnn and lf should be more performant given they are written in C and GO. I mostly just use fff as I mostly use for navigation in terminal (configured to switch to the current directory upon exit of fff).

  5. not a name said on November 1, 2019 at 1:51 pm
    Reply

    There’s also fff (https://github.com/dylanaraps/fff) written in pure bash.

    1. is anon said on November 2, 2019 at 6:01 pm
      Reply

      If I want to settle for a script, I would pick the more featured ranger. Also, the bash dependency is enforced on a zsh user like me.

  6. rip said on November 1, 2019 at 12:29 pm
    Reply

    Very nice! I fired up a copy of bash in WSL and ran nnn on my Windows folders. Works perfectly.

    You know, Ashwin and Martin, you’re putting so many new goodies out there that I just HAVE to try – I’m losing hours of productivity every week. :-)

  7. Flotsam said on November 1, 2019 at 11:03 am
    Reply

    I’m still waiting for XTree for Linux.

    1. rip said on November 1, 2019 at 12:32 pm
      Reply

      Try http://www.unixtree.org/.

      I haven’t, but it looks like it might do the job.

  8. Sigitas said on November 1, 2019 at 10:12 am
    Reply

    My favorite file manager is Midnight Commander. But i’ll try nnn.

    1. Shane said on November 2, 2019 at 4:49 pm
      Reply

      I replaced mc with nnn since it added the support for SSHFS. While mc is an excellent file manager, it’s predominantly menu-driven with confirmation boxes popping up every now and then. nnn on the other hand, is shortcut driven with a clean/minimal interface. It has all the features I used in mc and even some more like disk usage, image/video previews. Speaking of previews, the plugin framework is a BIG plus – you can add any functionality very easily.

    2. Radical Dreamer said on November 2, 2019 at 7:48 am
      Reply

      Same here

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.