File manager

A powerful terminal-based file manager for experienced Linux users

There are many terminal-based programs aimed at experienced Linux users, and the nnn file manager is one of them. It is a deceptively simple but extremely configurable program. Here’s how to install and use it.

What is nnn?

nnn is a file manager for Unix-like systems including Linux, macOS, and Windows under WSL. The project is led by Arun Prakash Jana. The project’s main hub is its GitHub page, where you can also download the source code.

Install nnn on Linux

Installing nnn is quite simple. You can simply use your distro’s package manager.

For example, on Debian or Ubuntu:

sudo apt install nnn

On Arch Linux:

pacman -S nnn

To install nnn on Red Hat, CentOS, Fedora or Rocky Linux:

sudo dnf install nnn

Managing Files in Linux with nnn

To start nnn, just type “nnn” in the shell. You can navigate the filesystem with the arrow keys or by using the Vim keys.

You don’t need to memorize commands. You can press “?” to display the help screen. This will show you all the key combinations for nnn.

You can switch between four “contexts” of nnn. They are similar to browser tabs. You can access a directory in one context while selecting a different directory in another. You can copy a file from one location to another.

The keyboard commands for moving are based on Vim: “h“for left”I“for the down”k“for more, and”I” to the right. You can also use the arrow keys. To access a directory, move right or press Walk in. To go up one directory, press left.

Luckily, you don’t have to memorize commands. You can see keyboard shortcuts at any time by pressing “?“.

You can search the lists by pressing “/“. This is useful if you are in a directory with a lot of files.

nnn plugins

Like many Linux programs aimed at power users, nnn comes with a plug-in system that allows you to customize it to your preferences.

It is easy to configure nnn plugins. There is already a collection installed in the ~/.config/nnn/plugins phone book.

Plugins are mostly implemented as shell scripts. To run them, you just need to bind them to keys with the NNN_PLUG environment variable. You would put this in the shell startup file, such as .bashrc for Bash or .zsh for Zsh.

To call the plugins, you press the semicolon (;), followed by the key you bound the plugin to when you run NNN.

For example, to invoke the launch plugin, you need to configure it with NNN_PLUG:

export NNN_PLUG='l:launcher'

When you press the semicolon (;), followed by the lowercase L (l), you open the launcher which you can use to find and launch apps, even GUI apps.

To run a plugin on startup, start nnn with the -P option, followed by the key of the plugin you want to run. You probably want to set it as a shell alias if you want to do this frequently.

What can you do with nnn plugins? Many things.

Do you like to listen to music while you work? You can ask nnn to play random songs with boom.

Many of these plugins have dependencies that you may need to install before using them. They are listed on the GitHub page and many can be installed through your distro’s package manager.

The long list of programs shows that the terminal still has a hold on the imagination of serious Linux users and why Linux is a tech-savvy favorite. The list of plugins will only grow as more and more developers come up with their own extensions. It already seems that the functionality of nnn is limited only by your imagination.

A powerful terminal-based file manager

There is no shortage of tools for managing files in Linux. nnn, with its customization via plugins, will become the tool of choice for an experienced Linux user.

Overall, Linux filesystems are complex and the choice of filesystem is subtle but important and will affect the behavior of the system under the hood. Two of the biggest are ext4 and Btrfs.