nnn
Ultra-lightweight and blazing fast file manager.
Official WebsiteFeatures
Installation
brew install nnnapt install nnnpacman -S nnnWhy use nnn?
Ultra Fast
One of the fastest file managers, written in C. Optimizes disk I/O and displays even 100,000+ file directories instantly.
Ultra Lightweight
Binary around 100KB, memory usage a few MB. Works on embedded systems and resource-constrained environments.
Plugin System
Extensible with many plugins. Add diverse features like fzf integration, preview, and archive operations.
4 Contexts
Four independent contexts (similar to tabs) allowing simultaneous operations on multiple directories.
Installation
# Homebrew (macOS/Linux)
brew install nnn
# APT (Debian/Ubuntu)
sudo apt install nnn
# Pacman (Arch Linux)
sudo pacman -S nnn
# DNF (Fedora)
sudo dnf install nnn
# Build from source
git clone https://github.com/jarun/nnn.git
cd nnn
make
sudo make installNerd Font is required for icon display. With Homebrew, add the --with-nerdicons option.
Screen Layout
nnn uses a very simple single-pane layout. Preview can be added via plugins.
┌─ nnn v4.9 ────────────────────────────────────────────────────┐ │ │ │ ~/.config │ │ │ │ .. │ │ alacritty/ │ │ btop/ │ │ fish/ │ │ git/ │ │ kitty/ │ │ > nnn/ │ │ nvim/ │ │ ranger/ │ │ │ │ │ ├───────────────────────────────────────────────────────────────┤ │ 1/12 | ~/.config | 4.2M | 256 free │ └───────────────────────────────────────────────────────────────┘ [1-4] Context [/] Search [?] Help [q] Quit
Basic Operations
| Key | Action |
|---|---|
j / k or ↑ / ↓ | Move up/down |
h / ← | Go to parent directory |
l / → / Enter | Enter directory / Open file |
Home / g | Go to start |
End / G | Go to end |
/ | Search (real-time filter) |
. | Toggle hidden files |
? | Show help |
q | Quit |
File Operations
| Key | Action |
|---|---|
Space | Select/deselect file |
a | Select all |
A | Invert selection |
p | Copy |
v | Move |
x | Delete |
Ctrl+R | Rename |
n | Create new file/directory |
r | Bulk rename |
Contexts (Tabs)
nnn has four independent contexts. Each maintains its own directory history and selection state.
| Key | Action |
|---|---|
1-4 | Switch to context 1-4 |
Tab | Move to next context |
` | Move to previous context |
Configuration & Customization
nnn is configured with environment variables. No config file, add to shell configuration.
# ~/.bashrc or ~/.zshrc
# Configure nnn with environment variables
export NNN_PLUG='f:finder;o:fzopen;p:preview-tui;d:diffs;t:nmount;v:imgview'
export NNN_FIFO=/tmp/nnn.fifo
export NNN_COLORS='#0a1b2c3d'
export NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
export NNN_TRASH=1
export NNN_ARCHIVE="\.(7z|bz2|gz|tar|tgz|zip|rar)$"
# For preview (with tmux/kitty etc.)
export NNN_PREVIEW=1
# Bookmarks
export NNN_BMS='d:~/Documents;D:~/Downloads;c:~/.config;g:~/github'
# For icon display (requires Nerd Font)
# brew install nnn --with-nerdiconsPlugins
Launch plugins with the ; key. Configure plugins with the NNN_PLUG environment variable.
# Install plugins
curl -Ls https://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs | sh
# Plugins will be installed to ~/.config/nnn/plugins/
# Popular plugins
# preview-tui - Terminal preview
# fzopen - File selection with fzf
# finder - Search plugin
# diffs - Show differences
# imgview - Image preview
# nmount - Mount management
# dragdrop - Drag & drop supportPopular Plugins
preview-tui- Preview with tmux/kittyfzopen- File search with fzfdiffs- Show differencesimgview- Image preview
How to Use Plugins
Press ; then the configured key to launch. Example: ;p launches preview-tui
Shell Integration
To preserve the current directory when nnn exits, add this function:
# ~/.bashrc or ~/.zshrc
# Preserve directory when nnn exits
n()
{
# Prevent nested nnn
[ "${NNNLVL:-0}" -eq 0 ] || {
echo "nnn is already running"
return
}
# Temporary file to get exit directory
NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# Launch nnn
command nnn "$@"
# Preserve directory
[ ! -f "$NNN_TMPFILE" ] || {
. "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE" > /dev/null
}
}
# Alias settings
alias N='sudo -E nnn -dH'Tips
Bookmarks
Press b to open bookmark menu. Configure bookmarks with NNN_BMS environment variable.
Disk Usage Analysis
Press d to show directory disk usage. Helpful for finding large files.
Change Sort Order
Press t to toggle sort order. Sort by name, size, modification time, etc.
Symbolic Links
Press P to create symbolic link. Creates link to selected file in current directory.