NNN(1)
π nnn(1) β General Commands Manual π
okay so bestie, you asked about nnn and I am SO glad you did because this little icon of a file manager is genuinely the moment. let's get into it π«Ά
πΈ NAME πΈ
nnn β the unorthodox terminal file manager. that's it, that's the name, and yes it is serving exactly what it says. π
β¨ SYNOPSIS β¨
nnn [-aAcCdDeEfgHJKnQrRSuUVxz0h] [-b key] [-F val] [-l val] [-p file]
[-P key] [-s name] [-t secs] [-T key] [PATH]
look at all those letters, she's got range π
π¦ DESCRIPTION π¦
nnn (Nnn's Not Noice) is a performance-optimized, feature-packed fork of noice β link's right here bestie: http://git.2f30.org/noice/ β and she comes with seamless desktop integration, simplified navigation, type-to-nav mode with dir auto-enter, disk usage analyzer mode, bookmarks, contexts, application launcher, familiar navigation shortcuts, subshell spawning and much more. the way she does all of that and still remains a simple and efficient file manager that stays out of your way?? main character energy, no cap. π
now, the PATH situation, because this part is lowkey important:
- if you don't hand her a
PATH,nnnjust opens the current working directory. easy. - if you do pass a
PATHand it exists, she opens it. slay. - if the
PATHdoesn't exist and it ends with a/,nnnwill attempt to create the directory tree and open it. building it herself, iconic. β¨ - otherwise,
PATHis considered a path to a regular file, andnnnattempts to create the complete directory tree to the file, opens the parent directory, and prompts to create the new file in it with the base filename. she's proactive like that π
π KEYBINDS π
press ? in nnn to see the list of keybinds. yes, that's the whole section. she's mysterious. π
π₯ OPTIONS π₯
nnn supports the following options:
-aβ auto-setup temporaryNNN_FIFO(go peek at the ENVIRONMENT section for the tea β)-Aβ disable directory auto-enter on unique filter match-bkeyβ specify bookmark key to open-Bβ usebsdtarfor archives (default:atool)-cβ indicates that the opener is a cli-only opener (overrides-e)-Cβ 8-color scheme β color directories by context, disable file colors-dβ detail mode-Dβ show directories in context color withNNN_FCOLORSset-eβ open text files in$VISUAL(else$EDITOR, fallbackvi) [preferably CLI]-Eβ use$EDITORfor internal undetached edits-fβ use history file-Fvalβ fifo notification mode0: notify as previewer1: notify as explorer
-gβ use regex filters instead of substring match-Hβ show hidden files-iβ show current file information in info bar (may be slow π)-Jβ disable auto-advance on selection (eg. selecting an entry will no longer move cursor to the next entry)-Kβ test for keybind collision and exit-lvalβ number of lines to move per mouse wheel scroll-nβ start in type-to-nav mode-oβ open files only on Enter key-pfileβ copy (or pick) selection tofile, or stdout iffile='-'-Pkeyβ specify plugin key to run-Qβ disable confirmation on quit with multiple contexts active-rβ showcp,mvprogress (Linux-only, needsadvcpmv;^Tshows the progress on BSD/macOS)-Rβ disable rollover at edges (eg. pressing down while on the last entry will no longer move cursor to the first entry and vice-versa)-snameβ load a session by name-Sβ persistent session-tsecsβ idle timeout in seconds to lock terminal-Tkeyβ sort order (go read the SORTING section bestie)- keys:
'a'pparent disk usage /'d'isk usage /'e'xtension /'r'everse /'s'ize /'t'ime /'v'ersion - capitalize to reverse (except
'r')
- keys:
-uβ use selection if available, don't prompt to choose between selection and hovered entry-Uβ show user and group names in status bar-Vβ show version and exit-xβ- show notifications on selection
cp,mv,rmcompletion (requires the.ntfyplugin) - copy path to system clipboard on selection (requires the
.cbcpplugin) - show xterm title (if non-picker mode)
- show notifications on selection
-zβ use fuzzy filters (fuzzy match: all characters in filter appear in order)-0β use null separator (instead of newline) to separate file paths in picker mode outout-hβ show program help and exit
not me noticing the original literally spells it "outout" in -0β¦ I'm keeping it exactly as written, bestie, because the rule is the facts do not change. π«Ά
π CONFIGURATION π
There is no configuration file. say it with me: no config file. associated files live at
${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
Configuration is done using a few optional (set if you need) environment variables β head to the ENVIRONMENT section for the full rundown.
nnn uses xdg-open (on Linux), open(1) (on macOS), cygstart on (Cygwin) and open on (Haiku) as the desktop opener. It's also possible to specify a custom opener β again, ENVIRONMENT section, go go go β¨
π CONTEXTS π
Open multiple locations with 8 contexts. The status is shown in the top left corner:
- the current context is in reverse video
- other active contexts are underlined
- rest are inactive
A new context copies the state of the previous context. Each context can have its own color. Refer to the ENVIRONMENT section. π¨
π SESSIONS π
Sessions are a way to save and restore states of work. A session stores the settings and contexts. Sessions can be loaded at runtime or with a program option.
- When a session is loaded at runtime, the last working state is saved automatically to a dedicated "auto session" session file. Session option restore would restore the "auto session".
- The persistent session option is global. If it is used, the last active session will be updated with the final state at program quit.
- The "auto session" is used in persistent session mode if no session is active.
- Listing input stream and opening a bookmark by key have a higher priority to session options (
-s/-S).
All the session files are located by session name in the directory
${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions
"@" is the "auto session" file. bestie, that little @ is doing so much work π
π FILTERS π
Filters are strings (or regex patterns) to find matching entries in the current directory instantly (search-as-you-type). Matches are case-insensitive by default. The last filter in each context is persisted at runtime or in saved sessions.
When there's a unique match and it's a directory, nnn auto enters the directory. Use the relevant program option to disable this.
Special keys at filter prompt:
^charβ Usual keybind functionalityEscβ Exit filter prompt but skip dir refresh/β Enter dir exactly matching filter
Special keys at empty filter prompt:
?β Show help and config screen/β Toggle between string, fuzzy, regex:β Toggle case-sensitivity^Lβ Clear filter (if prompt is non-empty) OR apply last filterBkspβ Stay at filter prompt and refresh dirDelβ Stay at filter prompt and refresh dir
Common regex use cases:
- To list all matches starting with the filter expression, start the expression with a
'^'(caret) symbol. - Type
'\.mkv'to list all MKV files. - Use
'.*'to match any character (sort of fuzzy search). - Exclude filenames having
'nnn'(compiled with PCRE2 lib):'^(?!nnn)'
In the type-to-nav mode directories are opened in filter mode, allowing continuous navigation.
Additional special keys at empty filter prompt in type-to-nav mode:
' Go to first non-dir file
+ Toggle file selection
, Mark CWD
- Go to last visited dir
. Show hidden files
; Run a plugin by its key
= Launch a GUI application
> Export file list
@ Visit start dir
] Show command prompt
` Visit /
~ Go HOME
(that first one is a backtick key, and the ` and ~ pair is lowkey poetic π)
β SORTING β
nnn will always show the directories first, followed by the files. String order is always case-insensitive.
The sort key can be set either with the -T program option, or interactively using t or ^T. The following options are available:
aβ apparent disk usage, how large the file appears to be, can be bigger than actual disk usage in sparse files.dβ disk usage, amount of data taken on disk, a multiple of the block size.eβ extension of the file.rβ reverse the current order (not available with-T).sβ size of file, amount of data stored in the file.tβ time, this depends on the currently selected time type which can be changed using theTkey. Options are:aβ access, last time the file was accessed.cβ change, last time the metadata of the file was changed (e.g. permissions).mβ modified, last time the content of the file was changed (default).
vβ version, sorts by filename while treating digit characters numerically. For example:j1.png,j02.png,j3.png.cβ clear, revert to filename order (not available with-T).^Tβ cycle between filename/size/time order (not available with-T).
The uppercase version of the option (except r) reverses the default order. By default, time and size sort keys are ordered in descending order, and alphabetical fields are ordered in ascending order. For example, when using the e option, the entries will be ordered by extension, in ascending order. Using E would result in descending order of the extensions. This means that e followed by r is the same as E. π§ β¨
π SELECTION π
okay so this is the part where nnn lets you select files across directories AND contexts β like, you're not stuck in one folder bestie, you can go wherever and keep stacking your lil chosen ones π
There's 3 groups of keybinds for adding files to your selection:
- (1) hovered file selection toggle β deselects if
+is visible before the entry, else adds to selection - (2) add a range of files to selection β repeat the range key on the same entry twice to clear selection completely
- (3) add all files in the current directory to selection
A selection can be edited, copied, moved, removed, archived or linked. (yes, all of that, it's giving versatility β¨)
Absolute paths of the selected files are copied to .selection file in the config directory. The selection file is shared between multiple program instances. Selection from multiple instances are not merged. The last instance writing to the file overwrites earlier contents. So if you have 2 instances of nnn open in 2 panes of a terminal multiplexer, you can select in one pane and use the selection in the other pane π«Ά. The selection gets cleared in the nnn instance where the selection was made on mv/rm (but not on cp).
nnn clears the selection after a successful operation with the selection. Plugins are allowed to define the behaviour individually.
To edit the selection use the edit selection key. Editing doesn't end the selection mode. You can add more files to the selection and edit the list again. If no file is selected in the current session, this option attempts to list the selection file.
nnn can show the total size of non-filtered selected files listed in a directory. For directories, only the size of the directory is added by default. To add the size of the contents of a directory, sort by disk usage (aka du mode). π
π FIND AND LIST π
There are two ways to search and list:
- feed a list of file paths as input
- search using a plugin (e.g.
finder) and list the results
File paths must be NUL-separated ('\0'). Paths and can be relative to the current directory or absolute. Invalid paths in the input are ignored. Input processing limit is 16,384 paths or 64 MiB (max_paths x max_path_len) of data. (like, that's the ceiling bestie, don't try it π)
To list the input stream, start nnn by writing to its standard input. E.g., to list files in current directory larger than 1M:
find -maxdepth 1 -size +1M -print0 | nnn
or redirect a list from a file:
nnn < files.txt
Handy bash/zsh shell function to list files by mime-type in current directory:
# to show video files, run: list video
list ()
{
find . -maxdepth 1 | file -if- | grep "$1" | awk -F: '{printf "%s%c", $1, 0}' | nnn
}
A temporary directory will be created containing symlinks to the given paths. Any action performed on these symlinks will be performed only on their targets, after which they might become invalid. β οΈ (so like, tread carefully, the vibes can get fragile)
>orlon a symlink in the listing dir takes to the target file. Press-to return to the listing dir. PressEnterto open the symlink.
Listing input stream can be scripted. It can be extended to pick (option -p) selected entries from the listed results. π
π BOOKMARKS π
There are 2 ways (can be used together) to manage bookmarks.
- Bookmark keys: See
NNN_BMSunder ENVIRONMENT section on how to set bookmark keys. The select bookmark keyblists all the bookmark keys set inNNN_BMSin the bookmarks prompt. - Symlinked bookmarks: A symlinked bookmark to the current directory can be created with the
Bkey (or manually under~/.config/nnn/bookmarks). PressingEnterat the bookmarks prompt takes to this directory. IfNNN_BMSis not set, the select bookmark key directly opens it.
On entering a bookmark, the directory where the select bookmark key was pressed is set as the previous directory. Press - to return to it. πβ¨
π UNITS π
The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y (powers of 1024), same as the default units in ls. periodt π
NNN_OPTS</p>
Binary options to nnn, bestie. Just stack 'em in a string:
export NNN_OPTS="cEnrx"
NNN_OPENER</p>
Wanna pick your own file opener? Say less:
export NNN_OPENER=nuke
NOTE: nuke is a file opener available in the plugin repository.
NNN_BMS</p>
Bookmark string, formatted as key_char:location pairs separated by ;:
export NNN_BMS="d:$HOME/Docs;u:/home/user/Cam Uploads;D:$HOME/Downloads/"
These bookmarks are listed in the help and config screen (key ?). So cute, so organized π
NNN_PLUG</p>
Directly executable plugins as key_char:plugin pairs separated by ;:
export NNN_PLUG='f:finder;o:fzopen;p:mocplay;d:diffs;t:nmount;v:imgview'
NOTES:
- To run a plugin directly, press
;followed by the key. - Alternatively, combine with
Alt(i.e.Alt+key). - To skip directory refresh after running a plugin, prefix with
-.
export NNN_PLUG='p:-plugin'
To assign keys to arbitrary non-background cli commands and invoke like plugins, add ! before the command.
export NNN_PLUG='x:!chmod +x "$nnn";g:!git log;s:!smplayer "$nnn"'
To pick and run an unassigned plugin, press Enter at the plugin prompt. To run a plugin at startup, use the option -P followed by the plugin key.
NOTES:
- Place
$nnn(or exported variables) in double quotes ("$nnn") - Use single quotes for
$NNN_PLUGso"$nnn"is not interpreted - (Again) add
!before the command - To disable directory refresh after running a command as plugin, prefix with
-! - To skip user confirmation after command execution, suffix with
*Note: Do not use*with programs those run and exit e.g.cat
export NNN_PLUG='y:-!sync*'
- To run a GUI app as plugin, add a
&after!.
export NNN_PLUG='m:-!&mousepad "$nnn"'
- To show the output of run-and-exit commands which do not need user input, add
|(pipe) after!Note: This option is incompatible with&(terminal output is masked for GUI programs) and ignores*(output is already paged for user).
export NNN_PLUG='m:-!|mediainfo "$nnn";t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
- To show the output of run-and-exit commands in a floating window, add
>(right arrow) after!Note: This option is incompatible with&(terminal output is masked for GUI programs) and ignores*(output is rendered in a floating window). Option-is ignored with this option. The directory is always refreshed.
export NNN_PLUG='m:!>mediainfo "$nnn";t:!>tree -ps;l:!>ls -lah --group-directories-first'
EXAMPLES:
------------------------------------ + -------------------------------------------------
Key:Command | Description
------------------------------------ + -------------------------------------------------
c:!convert "$nnn" png:- | xclip | Copy image to clipboard
-sel clipboard -t image/png* |
C:!cp -rv "$nnn" "$nnn".cp* | Create a copy of the hovered file
e:-!sudo -E vim "$nnn"* | Edit file as root in vim
g:-!git diff | Show git diff
h:-!hx "$nnn"* | Open hovered file in hx hex editor
k:-!fuser -kiv "$nnn"* | Interactively kill process(es) using hovered file
l:-!git log | Show git log
n:-!vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
p:-!less -iR "$nnn"* | Page through hovered file in less
s:-!&smplayer -minigui "$nnn" | Play hovered media file, even unfinished download
x:!chmod +x "$nnn" | Make the hovered file executable
y:-!sync* | Flush cached writes
------------------------------------ + -------------------------------------------------
Online docs: https://github.com/jarun/nnn/tree/master/plugins
NNN_ORDER</p>
Directory-specific sort key, periodt:
export NNN_ORDER='t:/home/user/Downloads;S:/tmp'
NOTE: Sort keys can bea/d/e/r/s/t/v(refer to the SORTING section). Path must be absolute. Timestamps for entries modified/created within 5 minutes are shown in reverse.
NNN_COLORS</p>
A string of color numbers for each context, e.g.:
# 8 color numbers:
# 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
export NNN_COLORS='12341234'
# xterm 256 color numbers (converted to hex, 2 symbols per context):
# see https://user-images.githubusercontent.com/1482942/93023823-46a6ba80-f5e1-11ea-9ea3-6a3c757704f4.png
export NNN_COLORS='#0a1b2c3d0a1b2c3d'
# both (256 followed by 8 as fallback, separated by ';')
export NNN_COLORS='#0a1b2c3d0a1b2c3d;12341234'
NOTE: If only 256 colors are specified and the terminal doesn't support, default is used.
NNN_FCOLORS</p>
File-type specific colors, the aesthetic layer π
export NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
Specify file-specific colors in xterm 256 color hex numbers (2 symbols per color). Order is strict, use 00 to omit/use default terminal color. Defaults:
------------------------- + --- + -------------
Order | Hex | Color
------------------------- + --- + -------------
Block device | c1 | DarkSeaGreen1
Char device | e2 | Yellow1
Directory | 27 | DeepSkyBlue1
Executable | 2e | Green1
Regular | 00 | Normal
Hard link | 60 | Plum4
Symbolic link | 33 | Cyan1
Missing OR file details | f7 | Grey62
Orphaned symbolic link | c6 | DeepPink1
FIFO | d6 | Orange1
Socket | ab | MediumOrchid1
Unknown OR 0B regular/exe | c4 | Red1
------------------------- + --- + -------------
If the terminal supports xterm 256 colors or more, file-specific colors will be rendered. To force the 8-color scheme use option -C. If xterm 256 colors aren't supported, 8-color scheme will be used.
NNN_ARCHIVE</p>
Archive extensions to be handled silently (default: bzip2, (g)zip, tar).
export NNN_ARCHIVE="\\.(7z|bz2|gz|tar|tgz|zip)$"
NOTE: Non-default formats may require a third-party utility.
NNN_ARCHMNT</p>
Optional archive mounter utility (default: archivemount).
export NNN_ARCHIVE='fuse-archive'
NNN_SSHFS</p>
Specify a custom sshfs command with options:
export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
NOTE: The options must be comma-separated without any space between them.
NNN_RCLONE</p>
Pass additional options to the rclone command:
export NNN_RCLONE='rclone mount --read-only --no-checksum'
NOTE: The options must be preceded by "rclone" and max 5 flags are supported.
NNN_TRASH</p>
Trash (instead of rm -rf) files to desktop Trash. No more accidental deletions, bestie π
export NNN_TRASH=cmd
NOTES:
cmdis the name/path of the binary thatnnnwill call for trashing files. E.g to use macOS's nativetrashcommand:export NNN_TRASH="trash"- Special value
"1"and"2"forcmdwill usetrash-cliandgio trashrespectively.
NNN_SEL</p>
Absolute path to custom selection file.
export NNN_SEL='/tmp/.sel'
NNN_FIFO</p>
Path of a named pipe to write the hovered file path:
export NNN_FIFO='/tmp/nnn.fifo'
NOTES:
- Overridden by a temporary path with
-aoption. - If the FIFO file doesn't exist it will be created, but not removed (unless it is generated by
-aoption).
Online docs: https://github.com/jarun/nnn/wiki/Live-previews
NNN_LOCKER</p>
Terminal locker program.
export NNN_LOCKER='bmon -p wlp1s0'
export NNN_LOCKER='cmatrix'
NNN_TMPFILE</p>
Always cd on quit and write the command in the file specified.
export NNN_TMPFILE='/tmp/.lastd'
NNN_HELP</p>
Run a program and show the output on top of the program help page.
export NNN_HELP='fortune'
NNN_MCLICK</p>
Key emulated by a middle mouse click.
export NNN_MCLICK='^R'
NOTE: Only the first character is considered if not a Ctrl+key combo.
nnn</p>
This is a special variable. π«Ά
Set to the hovered file name before starting the command prompt or spawning a shell.
NO_COLOR</p>
Disable ANSI color output (overridden by NNN_COLORS).
π AUTHORS π
Arun Prakash Jana <engineerarun@gmail.com>, Lazaros Koromilas <lostd@2f30.org>, Dimitris Papastamos <sin@2f30.org>.
π HOME π
and that's a wrap, bestie β this page is from Debian, dated Aug 15, 2026, filed under NNN(1). go forth and file-manage iconically ππ
π¦ where this page comes from
- arch rolling: nnn 5.3-1 Β· BSD-2-Clause
- fedora 43: nnn 5.3-1.fc43 Β· BSD-2-Clause
- fedora 44: nnn 5.3-1.fc44 Β· BSD-2-Clause
- nixpkgs unstable: nnn 5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms