System Administration

Excellent System Tools: nnn – portable terminal file manager

Last Updated on May 28, 2022

In operation

nnn
Click for full size image

By default, the file manager looks clutter-free if rather barren, particularly compared to say Midnight Commander. The image to the left shows the original startup.

I prefer running nnn with a detailed view. This can be accessed by pressing d. Or do what I do, and create an alias in .bashrc (i.e. alias nnn=’nnn -d’). With the detailed view, you see the modification date/time, permissions, file size in a human readable form, and the names of the files/directories.

If you’ve used file managers like Midnight Commander, you’ll be accustomed to dual panes. The author of nnn doesn’t want to offer multi-pane functionality. He prefers we use a terminal multiplexer, an independent utility, to offer this functionality.

The next thing you’ll notice are the numbers 1, 2, 3 and 4. In nnn’s parlance they represent 4 contexts, which let you explore multiple directories simultaneously. Think of them as tabs. The status of the contexts are shown in the top left corner:

  • the current context is in reverse video;
  • other active contexts are underlined;
  • rest are inactive.

For navigation, nnn supports navigate-as-you-type with directory auto-select. Search-as-you-type is also supported. There’s a good range of other functionality such as a fuzzy app launcher, batch file renamer, file picker, remote mounts, bookmarks, and much more.

nnn’s keybindings are eminently sensible with common actions given memorable key presses. Things like l to view files, e to edit a file, p to open a file in a pager, and space to select a file. Moving and copying files is simple and quick. Just remember the keybindings are case-sensitive.

And there’s mouse support too which is actually useful for a variety of activities including contexts, although my workflow is better suited keeping my hands on the keyboard at all times possible.

I really like the program’s session management support, which lets me save my current nnn session and restore it later.

There’s no configuration file. Instead, you can set some environment variables which let you define up to 10 bookmark pairs, up to 15 plugins, set colours, custom scripts, use external programs for archives, and more.

Next page: Page 3 – Disk usage analyzer

Pages in this article:
Page 1 – Introduction / Installation
Page 2 – In Operation
Page 3 – Disk usage analyzer
Page 4 – Plugins
Page 5 – Memory Usage & Comparison with other console-based file managers
Page 6 – Summary

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Please read our Comment FAQ before posting a comment.

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Bear
Bear
4 years ago

What optimizations does nnn use? The developer’s website seems unclear on this.

kodekat
kodekat
4 years ago
Reply to  Bear

You’ll find the details here: https://github.com/jarun/nnn/wiki/Performance

Bear
Bear
4 years ago
Reply to  kodekat

Thanks, that’s very interesting.