ThisCalculator

Everyday

Nnn File Manager Terminal Guide

Updated · Standard formula, shown below

Average pace 5.00 min/km
Average speed
12.00 km/h
Result
Finish time
50 min
You entered
Distance
10 km
You entered

Nnn File Manager Terminal Guide

Nnn is a terminal-based file manager for Unix-like systems (Linux, macOS, BSD) that runs entirely inside a terminal window. You launch it by typing nnn in a shell, and you get a fast, keyboard-driven file browser that can replace the default file manager for many command-line users. This guide explains what nnn is, how it works, how to install and use it, and how it compares to other terminal file managers.

What Is nnn?

Nnn (pronounced “triple n�) is a free, open-source file manager that operates in a terminal. It was created by Arun Prakash Jana and first released in 2016. The name stands for “Noice Not Noice� – a nod to its predecessor, the Noice file manager. Nnn is written in C and has very few dependencies, making it extremely lightweight and fast. It runs on Linux, macOS, BSD, and other Unix-like systems. Because it uses the terminal, it works over SSH sessions, in a virtual console, or inside a terminal emulator like GNOME Terminal, Konsole, or iTerm2.

Why Use a Terminal File Manager?

Many users find a terminal file manager more efficient than a graphical one, especially when they already work in the terminal. Key reasons include:

  • Speed: No GUI overhead; nnn starts in milliseconds and responds instantly.
  • Remote work: Over SSH, you get a full file manager without a graphical desktop.
  • Keyboard-centric: All actions are available via shortcuts, so you never need a mouse.
  • Scriptability: Nnn can integrate with shell scripts, previews, and other tools.
  • Low resource usage: Uses minimal memory and CPU, ideal for older hardware or servers.

How nnn Works

When you start nnn, it displays a list of files in the current directory. You navigate with the arrow keys or with j and k (Vim-style). Press Enter to open a file with the default handler, or l to enter a directory. The bottom of the screen shows context information and available shortcuts. Nnn supports multiple tabs (called “contexts�), bookmarks, file search, and batch rename. It also has a plugin system for extending functionality, such as previewing files or mounting archives.

Installing nnn

Nnn is available in the package repositories of most major distributions. For example:

  • Debian/Ubuntu: sudo apt install nnn
  • Fedora: sudo dnf install nnn
  • Arch Linux: sudo pacman -S nnn
  • macOS: brew install nnn
  • FreeBSD: pkg install nnn

If you prefer to build from source, you can clone the repository from GitHub and run make. The only required dependency is a C compiler; optional features may need ncurses or other libraries.

Basic Usage and Key Shortcuts

After installation, type nnn in the terminal to start. The interface shows a list of files and directories. Here are the most essential shortcuts:

  • Arrow keys / j, k: Move up and down
  • Enter / l: Open file or enter directory
  • Backspace / h: Go to parent directory
  • q: Quit nnn
  • /: Search for a file by name
  • d: Toggle detailed view (size, permissions, date)
  • c: Create a new file or directory
  • r: Rename a file or directory
  • x: Cut (mark for move)
  • p: Paste (move or copy)
  • y: Copy (mark for copy)
  • Space: Select multiple files

These shortcuts are configurable via the configuration file. You can also set environment variables to change behavior, such as NNN_OPTS for default options.

Common Problems and Solutions

Users often encounter a few issues when starting with nnn:

  • Files don’t open with the right program: Nnn uses the xdg-open command on Linux to open files. If that’s not set up, install xdg-utils or set the NNN_OPENER environment variable to a custom opener.
  • No file previews: Previews require a plugin like preview-tui. Install the plugin and enable it with nnn -p or by adding it to NNN_PLUG.
  • Nnn doesn’t show hidden files: Press . to toggle hidden files, or start nnn with nnn -a to show them by default.
  • Can’t quit with q: If you have a plugin running, you may need to press q twice or use Ctrl+C to force quit.

Comparing nnn with Other Terminal File Managers

Nnn is not the only terminal file manager. Popular alternatives include:

  • Midnight Commander (mc): A classic twin-panel manager with a text-based interface. More feature-rich but heavier than nnn.
  • Ranger: A Python-based manager with a column layout and file previews. Easier to customize but slower and requires more dependencies.
  • Vifm: Vim-inspired, with a dual-pane interface and extensive keybindings. Good for Vim users.
  • lf: A lightweight manager written in Go, similar to ranger but faster.

Nnn stands out for its minimalism, speed, and low resource usage. It’s ideal for users who want a fast, scriptable file manager without extra features they don’t need.

Frequently Asked Questions

Is nnn available for Windows?

Nnn is designed for Unix-like systems and does not run natively on Windows. However, you can run it under WSL (Windows Subsystem for Linux) or Cygwin. That’s a common workaround, but the experience may not be as smooth as on Linux.

Can I use nnn over SSH?

Yes, that’s one of the main advantages. Since nnn runs in the terminal, you can use it in an SSH session just like any other command-line program. This gives you a full file manager on a remote server without needing a graphical environment.

How do I copy or move files with nnn?

To copy a file, navigate to it and press y to mark it for copying. Then go to the destination directory and press p to paste. For moving, use x instead of y. You can select multiple files with Space before copying or moving.

Does nnn support file previews?

By default, nnn does not show previews, but you can add a plugin like preview-tui to display images, text files, and PDFs in a terminal. The plugin uses tools like chafa or ueberzug for image previews. Set NNN_PLUG to enable it.

Can I change the default file opener?

Yes, set the NNN_OPENER environment variable to the command you want to use. For example, export NNN_OPENER=vi would open text files with Vim. Alternatively, you can use the -o flag when starting nnn to specify an opener.

Is nnn safe to use?

Yes, nnn is a well-maintained open-source program with no known security issues. It only performs file operations you explicitly initiate. However, as with any file manager, be careful when deleting or moving files, especially with recursive operations. Always double-check the target directory before pasting or deleting.

Related

Formula used
in t | Finish time | min | 50 | 0
in d | Distance | km | 10 | 0
out pace | Average pace | min/km | t / d | 2
out speed | Average speed | km/h | d / (t / 60) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.