"Fossies" - the Fresh Open Source Software Archive

Member "nnn-4.2/nnn.1" (21 Jul 2021, 17620 Bytes) of package /linux/misc/nnn-v4.2.tar.gz:

Caution: As a special service "Fossies" has tried to format the requested manual source page into HTML format but links to other man pages may be missing or even erroneous. Alternatively you can here view or download the uninterpreted manual source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "nnn.1": v4.1.1_vs_v4.2.

NNN(1) BSD General Commands Manual NNN(1)


nnn — The unorthodox terminal file manager.


nnn [-aAcCdDeEfgHJKnQrRSuUVwxh] [-b key] [-F val] [-l val] [-p file] [-P key] [-s name] [-t secs] [-T key] [PATH]


nnn (Nnn’s Not Noice) is a performance-optimized, feature-packed fork of noice http://git.2f30.org/noice/ with seamless desktop integration, simplified navigation, type-to-nav mode with auto select, disk usage analyzer mode, bookmarks, contexts, application launcher, familiar navigation shortcuts, subshell spawning and much more. It remains a simple and efficient file manager that stays out of your way.

nnn opens the current working directory by default if PATH is not specified.


Press ‘?’ in nnn to see the list of keybinds.


nnn supports the following options:

auto-setup temporary NNN_FIFO (described in ENVIRONMENT section)

disable directory auto-select in type-to-nav mode

−b key
specify bookmark key to open

indicates that the opener is a cli-only opener (overrides -e)

8-color scheme - color directories by context, disable file colors

detail mode

show directories in context color with NNN_FCOLORS set

open text files in $VISUAL (else $EDITOR, fallback vi) [preferably CLI]

use $EDITOR for internal undetached edits

use readline history file

−F val
fifo notification mode
0: notify as previewer, 1: notify as explorer

use regex filters instead of substring match

show hidden files

disable auto-proceed on select

test for keybind collision

−l val
number of lines to move per mouse wheel scroll

start in type-to-nav mode

open files only on Enter key

−p file
copy (or pick) selection to file, or stdout if file=’-’

−P key
specify plugin key to run

disable confirmation on quit with multiple contexts active

show cp, mv progress
(Linux-only, needs advcpmv; ’^T’ shows the progress on BSD/macOS)

disable rollover at edges

−s name
load a session by name

persistent session

−t secs
idle timeout in seconds to lock terminal

−T key
sort order
keys: ’a’u / ’d’u / ’e’xtension / ’r’everse / ’s’ize / ’t’ime / ’v’ersion

use selection if available, don’t prompt to choose between selection and hovered entry

show user and group names in status bar

show version and exit

place hardware cursor on hovered entry

show notis on selection cp, mv, rm completion
copy path to system clipboard on select
show xterm title (if non-picker mode)

show program help and exit


There is no configuration file. Associated files are at


Configuration is done using a few optional (set if you need) environment variables. See ENVIRONMENT section.

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. See ENVIRONMENT section.


Open multiple locations with 4 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. See ENVIRONMENT section.


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


"@" is the "auto session" file.


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.

Special keys at filter prompt:

-------- + ---------------------------------------
Key | Function
-------- + ---------------------------------------
^char | Usual keybind functionality
Esc | Exit filter prompt but skip dir refresh
Alt+Esc | Exit filter prompt and refresh dir
-------- + ---------------------------------------

Special keys at empty filter prompt:

------ + ---------------------------------------
Key | Function
------ + ---------------------------------------
? | Show help and config screen
/ | Toggle between string and regex
: | Toggle case-sensitivity
^L | Clear filter (if prompt is non-empty)
| OR apply last filter
Bksp | Stay at filter prompt and refresh dir
Del | Stay at filter prompt and refresh dir
------ + ---------------------------------------

Additional special keys at empty filter prompt in type-to-nav mode:

------ + ------------------------
Key | Function
------ + ------------------------
’ | Go to first non-dir file
+ | Toggle auto-advance
, | 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
------ + ------------------------

Common regex use cases:

(1) To list all matches starting with the filter expression,
start the expression with a ’^’ (caret) symbol.
(2) Type ’\.mkv’ to list all MKV files.
(3) Use ’.*’ to match any character (sort of fuzzy search).
(4) Exclude filenames having ’nnn’ (compiled with PCRE lib): ’^(?!nnn)’

In the type-to-nav mode directories are opened in filter mode, allowing continuous navigation.
When there’s a unique match and it’s a directory, nnn auto selects the directory and enters it in this mode. Use the relevant program option to disable this behaviour.


nnn allows file selection across directories and contexts!

There are 3 groups of keybinds to add files to 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.

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. 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.

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.


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 limit is 65,536 paths or 256 MiB of data.

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 ", $1}’ | 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.

Right arrow or ’l’ on a symlink in the listing dir takes to the target file. Press ’-’ to return to the listing dir. Press ’Enter’ to open the symlink.

Listing input stream can be scripted. It can be extended to pick (option -p) selected entries from the listed results.


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.


The SHELL, VISUAL (else EDITOR) and PAGER environment variables are used. A single combination of arguments is supported for SHELL and PAGER.

NNN_OPTS: binary options to nnn

export NNN_OPTS="cEnrx"

NNN_OPENER: specify a custom file opener.

export NNN_OPENER=nuke

NOTE: ’nuke’ is a file opener available in the plugin repository.

NNN_BMS: bookmark string as key_char:location pairs separated by ;:

export NNN_BMS="d:$HOME/Docs;u:/home/user/Cam Uploads;D:$HOME/Downloads/"

NNN_PLUG: 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’

1. To run a plugin directly, press ; followed by the key.
2. Alternatively, combine with Alt (i.e. Alt+key).
3. To skip directory refresh after running a plugin, prefix with -.

export NNN_PLUG=’p:-plugin’

To assign keys to arbitrary non-background non-shell-interpreted cli
commands and invoke like plugins, add ! (underscore) before the

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.

1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
2. $nnn should be the last argument (IF used)
3. (Again) add ! before the command
4. To disable directory refresh after running a command as plugin,
prefix with -!
5. 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*’

6. To run a GUI app as plugin, add a & after !

export NNN_PLUG=’m:-!&mousepad $nnn’

7. 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’

----------------------------------- + -------------------------------------------------
Key:Command | Description
----------------------------------- + -------------------------------------------------
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_COLORS: 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=’1234’

# 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=’#0a1b2c3d’

# both (256 followed by 8 as fallback, separated by ’;’)
export NNN_COLORS=’#0a1b2c3d;1234’

NOTE: If only 256 colors are specified and the terminal doesn’t support, default is used.

NNN_FCOLORS: specify file-type specific colors:

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: 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_SSHFS: specify 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: pass additional options to 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: trash (instead of rm -rf) files to desktop Trash.

export NNN_TRASH=n
# n=1: trash-cli, n=2: gio trash

NNN_SEL: absolute path to custom selection file.

NNN_FIFO: path of a named pipe to write the hovered file path:

export NNN_FIFO=’/tmp/nnn.fifo’

1. Overridden by a temporary path with -a option.
2. If the FIFO file doesn’t exist it will be created,
but not removed (unless it is generated by -a option).

Online docs: https://github.com/jarun/nnn/wiki/Live-previews

NNN_LOCKER: terminal locker program.

export NNN_LOCKER=’bmon -p wlp1s0’
export NNN_LOCKER=’cmatrix’

NNN_HELP: run a program and show the output on top of the program help page.

export NNN_HELP=’fortune’

NNN_MCLICK: 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: this is a special variable.

Set to the hovered file name before starting the command prompt or spawning a shell.

NO_COLOR: disable ANSI color output (overridden by NNN_COLORS).


Arun Prakash Jana <engineerarun@gmail.com>,
Lazaros Koromilas <lostd@2f30.org>,
Dimitris Papastamos <sin@2f30.org>.



BSD Jul 21, 2021 BSD