A curses library with wide char support (e.g. ncursesw), libc and libreadline (optional).
| Utility deps | Install? | Operation |
|---|---|---|
| xdg-open (Linux), open(1) (macOS), cygstart (Cygwin), open (Haiku) | base | default opener |
| file, coreutils (cp, mv, rm), xargs, sed (gnu-sed on macOS) | base | file type, copy, (re)move |
| tar, (un)zip [atool/bsdtar for more formats] | base | create, list, extract bzip2, (g)zip, tar |
| archivemount, fusermount(3)/umount (macOS) | optional | (un)mount archives |
| sshfs, rclone, fusermount(3)/umount (macOS) | optional | (un)mount remotes |
| gio trash, trash-cli | optional | trash files (default: rm -rf) |
vlock (Linux), bashlock (macOS), lock(1) (BSD), peaclock (Haiku), $NNN_LOCKER |
optional | lock terminal |
| advcpmv (Linux) (integration) | optional | copy, move progress |
| fortune | optional | random quotes in help |
$VISUAL (else $EDITOR), $PAGER, $SHELL |
optional | fallback vi, less, sh |
TL;DR: Can't install packages? Get the statically linked binary from the latest release.
Packaging status (expand)
Unlisted packagers:
● CentOS (yum --enablerepo=epel install nnn)
● iSH (apk add nnn)
● Milis Linux (mps kur nnn)
● NuTyX (cards install nnn)
● Sailfish OS (devel-su zypper install nnn)
● Source Mage (cast nnn)
Packages for Arch Linux, CentOS, Debian, Fedora, Ubuntu and a static binary are generated with the latest release.
Download the latest release or clone this repo (risky), install deps and compile. On Ubuntu 18.04:
sudo apt-get install pkg-config libncursesw5-dev libreadline-dev
sudo make strip installPREFIX is supported, in case you want to install to a different location.
See the developer guides for source verification, platform-specific notes and other tips.
Completion scripts for Bash, Fish and Zsh are available. Refer to your shell's manual to install.
The new colorscheme (config NNN_FCOLORS) - a feast for your eyes!
There is no config file. Associated files are at
${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
Use plugin nbak to backup configuration.
nnn supports a few optional (set if you need) environment variables.
Example export |
Description |
|---|---|
NNN_OPTS="cEnrx" |
binary options to nnn |
NNN_OPENER="/path/to/custom/opener" |
custom opener (see plugin nuke) |
NNN_BMS="d:$HOME/Documents;D:$HOME/Docs archive/" 1 |
key-bookmark pairs |
NNN_PLUG='o:fzopen;m:nmount;x:_chmod +x $nnn' 1 |
key-plugin (or cmd) pairs |
NNN_ARCHIVE="\\.(7z|bz2|gz|tar|tgz|zip)$" 2 |
archives [default: bzip2, (g)zip, tar] |
NNN_COLORS='1234' (/'#0a1b2c3d'/'#0a1b2c3d;1234') 3 5 |
context colors [default: '4444' (blue)] |
NNN_FCOLORS='c1e2272e006033f7c6d6abc4' 4 |
file-specific colors |
NNN_SSHFS='sshfs -o reconnect,idmap=user' 5 |
custom SSHFS cmd |
NNN_RCLONE='rclone mount --read-only' 5 |
custom rclone cmd |
NNN_TRASH=n (n=1: trash-cli, n=2: gio trash) |
use desktop Trash [default: delete] |
NNN_SEL='/tmp/.sel' |
custom selection file |
NNN_FIFO='/tmp/nnn.fifo' 6 |
FIFO to write hovered file path to |
NNN_LOCKER='saidar -c' |
terminal locker |
NNN_MCLICK='^R' 7 |
key emulated by middle mouse click |
NO_COLOR=1 8 |
disable ANSI color output |
-
Key-bookmark and key-plugin pairs are listed in the help and config screen (key ?).
-
With
atoolorbsdtarinstalled you can have:export NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$"bsdtarcan extract, list andarchivemountcan mount ISO 9660 cdrom images (extn: iso). -
Understands 8 color, xterm 256 color or both.
Hexadecimal numbers representing xterm 256 colors, note that the width has to be 2, e.g. "5" becomes "05"
- 8 colors numbers: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white.
- To specify xterm 256 color hex numbers, prefix with
#(2 symbols per context). - To specify both, export 256 color hex numbers followed by 8 color number as fallback, separated by
;.
-
Specify file-specific colors in xterm 256 color hex numbers (2 hex symbols per color).
Order is strict, use
00to omit/use default terminal color. Defaults:Order Hex Color Block device c1DarkSeaGreen1 Char device e2Yellow1 Directory 27DeepSkyBlue1 Executable 2eGreen1 Regular 00Normal Hard link 60Plum4 Symbolic link 33Cyan1 Missing OR file details f7Grey62 Orphaned symbolic link c6DeepPink1 FIFO d6Orange1 Socket abMediumOrchid1 Unknown OR 0B regular/exe c4Red1 - 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.
- More Themes.
-
nnnv2.9 and below haveNNN_CONTEXT_COLORS,NNN_SSHFS_OPTSandNNN_RCLONE_OPTS. -
If the FIFO file doesn't exist it will be created, but it will never be removed.
-
Only the first character is considered if not a
Ctrl-keycombo. -
Overridden by
NNN_COLORS.
usage: nnn [OPTIONS] [PATH]
The missing terminal file manager for X.
positional args:
PATH start dir/file [default: .]
optional args:
-a auto NNN_FIFO
-A no dir auto-select
-b key open bookmark key (trumps -s/S)
-c cli-only NNN_OPENER (trumps -e)
-C 8-color scheme
-d detail mode
-D dirs in context color
-e text in $VISUAL/$EDITOR/vi
-E internal edits in EDITOR
-f use readline history file
-F show fortune
-g regex filters
-H show hidden files
-J no auto-proceed on select
-K detect key collision
-l val set scroll lines
-n type-to-nav mode
-o open files only on Enter
-p file selection file [stdout if '-']
-P key run plugin key
-Q no quit confirmation
-r use advcpmv patched cp, mv
-R no rollover at edges
-s name load session by name
-S persistent session
-t secs timeout to lock
-T key sort order [a/d/e/r/s/t/v]
-u use selection (no prompt)
-U show user and group
-V show version
-w place HW cursor on hovered
-x notis, selection sync, xterm title
-h show help
The list below is from master. Press ? in nnn to see the keybinds in your installed version.
NAVIGATION
Up k Up PgUp ^U Scroll up
Dn j Down PgDn ^D Scroll down
Lt h Parent ~ ` @ - ~, /, start, prev
Ret Rt l Open ' First file/match
g ^A Top . Toggle hidden
G ^E End + Toggle auto-advance
b ^/ Bookmark key , Mark CWD
1-4 Context 1-4 (Sh)Tab Cycle/new context
Esc Send to FIFO ^L Redraw
Q Pick/err, quit ^G QuitCD
q Quit context 2Esc ^Q Quit
? Help, conf
FILTER & PROMPT
/ Filter Alt+Esc Unfilter, quit context
Esc Exit prompt ^L Clear prompt/last filter
^N Toggle type-to-nav
FILES
o ^O Open with... n Create new/link
f ^F File details d Detail mode toggle
^R Rename/dup r Batch rename
z Archive e Edit file
* Toggle exe > Export list
Space ^J (Un)select m-m Mark range/clear sel
a Select all A Invert sel
p ^P Copy sel here w ^W Cp/mv sel as
v ^V Move sel here E Edit sel
x ^X Delete
MISC
Alt ; Select plugin = Launch app
! ^] Shell ] Cmd prompt
c Connect remote u Unmount remote/archive
t ^T Sort toggles s Manage session
T Set time type 0 Lock
Notes:
- Shift-TAB attempts to create a new context, and reverse cycles when all contexts are active.
- At the filter prompt, ^L toggles last filter and unfilter. If no last filter, exits filter mode and redraws.
- Q quits with
EXIT_FAILUREif no selection, else prints the selection to stdout and quits withEXIT_SUCCESS. - Help & settings, file details and archive listing are shown in the
$PAGER. - To change shortcuts modify key bindings in
nnn.hand compile. Option-Kdetects collisions.
(
| Mouse click | Function |
|---|---|
| Left single on context number | Visit context |
| Left single on current path | Visit parent |
| Left single/double on last 2 rows | Toggle type-to-nav |
| Left single | Select context or entry |
| Left double | Select context or open entry |
| Right single | Add entry to selection |
| Middle single | User configured |
Some control keybinds may not work if they are mapped by stty. To confirm, run stty -a and look for keybind conflicts. Some common ones are: ^Q (start), ^S (stop), ^V (lnext).
To remove the stty mapping:
stty start undef
stty stop undef
stty lnext undef
| Listing 1 | Listing 2 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Note:
- All links (hard/sym) are dimmed.
| Symbol | Meaning |
|---|---|
x/y |
current file num / total |
+/*(n) |
selection mode on/range selection on (buffered selected count) [reversed] |
H |
hidden files are listed |
M |
modification time sorted |
A |
access time sorted |
C |
change time sorted |
S |
size sorted |
E |
file extension sorted |
V |
version sorted |
R |
reverse sorted |
du |
disk usage |
au |
apparent disk usage |
-> |
symbolic link target |
n-n |
num hard links - inode number |
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.
nnn -h
man nnnTo lookup keyboard shortcuts at runtime, press ?.
user1: How it compares to Midnight Commander ?
user2: It works in daylight too.
- from a reddit conversation


