0% found this document useful (0 votes)
42 views8 pages

A - A - B Key - C - C - D - e - E - F - F - G - H - K - L - N - P File - P Key - Q - R - R - S Name - S - T Secs - T Key - U - V - W - X - H Path

nnn is a terminal file manager for Unix systems that provides a simple interface while being highly customizable. It allows navigating and filtering files, managing bookmarks and sessions, and has selections capabilities to perform batch operations on multiple files. Key features include intuitive navigation, disk usage analysis, application launching, and integration with plugins.

Uploaded by

ceci
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views8 pages

A - A - B Key - C - C - D - e - E - F - F - G - H - K - L - N - P File - P Key - Q - R - R - S Name - S - T Secs - T Key - U - V - W - X - H Path

nnn is a terminal file manager for Unix systems that provides a simple interface while being highly customizable. It allows navigating and filtering files, managing bookmarks and sessions, and has selections capabilities to perform batch operations on multiple files. Key features include intuitive navigation, disk usage analysis, application launching, and integration with plugins.

Uploaded by

ceci
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

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

NAME
nnn — the missing terminal file manager for X

SYNOPSIS
nnn [-a] [-A] [-b key] [-c] [-C] [-d] [-e] [-E] [-f] [-F] [-g] [-H] [-K] [-l] [-n]
[-p file] [-P key] [-Q] [-r] [-R] [-s name] [-S] [-t secs] [-T key] [-u] [-V]
[-w] [-x] [-h] [PATH]

DESCRIPTION
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 ana-
lyzer 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.

KEYBINDS
Press ? in nnn to see the list of keybinds.

OPTIONS
nnn supports the following options:
-a
auto-setup temporary NNN_FIFO (described in ENVIRONMENT section)
-A
disable directory auto-select in type-to-nav mode
-b key
specify bookmark key to open
-c
indicates that the opener is a cli-only opener (overrides -e)
-C
earlier colorscheme - color directories by context, disable file colors
-d
detail mode
-e
open text files in $VISUAL (else $EDITOR, fallback vi) [preferably CLI]
-E
use $EDITOR for internal undetached edits
-f
use readline history file
-F
show fortune in help and settings screen
-g
use regex filters instead of substring match
-H
show hidden files

BSD Aug 18, 2020 1


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

-K
test for keybind collision
-l val
number of lines to move per mouse wheel scroll
-n
start in type-to-nav mode
-o
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
-Q
disable confirmation on quit with multiple contexts active
-r
show cp, mv progress
(Linux-only, needs advcpmv; ’ˆT’ shows the progress on BSD/macOS)
-R
disable rollover at edges
-s name
load a session by name
-S
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
-u
use selection if available, don’t prompt to choose between selection and hovered entry
-V
show version and exit
-w
place hardware cursor on hovered entry
-x
show notis on selection cp, mv, rm completion
copy path to system clipboard on select
-h
show program help and exit

CONFIGURATION
There is no configuration file. Associated files are at

BSD Aug 18, 2020 2


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

${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
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 desk-
top opener. It’s also possible to specify a custom opener. See ENVIRONMENT section.

CONTEXTS
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 ENVIRON-
MENT section.

SESSIONS
Sessions are a way to save and restore states of work. A session stores the settings and contexts.
Sessions can be loaded dynamically at runtime or with a program option.
When a session is loaded dynamically, the last working session is saved automatically to a dedicated -- "last
session" -- session file. The "last session" is also used in persistent session mode.
All the session files are located by session name in the directory
${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions
"@" is the "last session" file.

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

BSD Aug 18, 2020 3


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

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.

SELECTION
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. The most recent instance writing to the file overwrites the entries
from earlier writes. If you have 2 instances if nnn open in 2 panes of a terminal multiplexer, you can select
in one pane and use the selection (e.g. to copy or move) in the other pane (if the instance doesn’t have any lo-
cal selection already).
nnn clears the selection after file removal, batch-rename and link creation with selection. However, it is re-
tained after archive creation with selection as the user may want to delete the archived files next.
To edit the selection use the _edit selection_ key. Use this key to remove a file from selection after you navi-
gate away from its directory. 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.

BSD Aug 18, 2020 4


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

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. In-
valid 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}’ |
}
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.

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 de-
fault units in ls.

ENVIRONMENT
The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables are used. A single combina-
tion 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:˜/Documents;u:/home/user/Cam Uploads;D:˜/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’

NOTES:
1. To run a plugin directly, press ; followed by the key.

BSD Aug 18, 2020 5


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

2. Alternatively, combine with Alt (i.e. Alt+key).


3. To skip directory refresh after running a plugin, prefix with -.

export NNN_PLUG=’m:-mediainf’
To assign keys to arbitrary non-background non-shell-interpreted cli
commands and invoke like plugins, add _ (underscore) 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:
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’

EXAMPLES:
----------------------------------- + -------------------------------------------------
Key:Command | Description
----------------------------------- + -------------------------------------------------
g:-_git diff | Show git diff
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
----------------------------------- + -------------------------------------------------
NNN_COLORS: string of color codes for each context, e.g.:
# 8 color codes
# codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan
export NNN_COLORS=’1234’

# xterm 256 color codes (in hex, 2 symbols per context)


# codes: https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_cha
export NNN_COLORS=’#0a1b2c3d’

# both (256 followed by 8 as fallback, separated by ’;’)

BSD Aug 18, 2020 6


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

export NNN_COLORS=’#0a1b2c3d;1234’

NOTE: If only 256 colors are specified and the terminal doesn’t support, defaul
NNN_FCOLORS: specify file-type specific colors:
export NNN_FCOLORS=’c1e2272e006033f7c6d6abc4’

Specify file-specific colors with xterm 256 color codes (2 hex symbols per colo
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
To force the earlier colorscheme (dirs follow context color) use option -C.
If xterm 256 colors aren’t supported, earlier colorscheme 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: pass additional options to sshfs command:
export NNN_SSHFS=’sshfs -o reconnect,idmap=user,cache_timeout=3600’

NOTE: The options must be preceded by "sshfs" and comma-separated without any s
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 delete) files to desktop Trash.
export NNN_TRASH=1
NNN_SEL: absolute path to custom selection file.

BSD Aug 18, 2020 7


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

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


export NNN_FIFO=’/tmp/nnn.fifo’

NOTES:
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).
https://github.com/jarun/nnn/wiki/Live-previews
NNN_LOCKER: terminal locker program.
export NNN_LOCKER=’bmon -p wlp1s0’
export NNN_LOCKER=’cmatrix’
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 s
NO_COLOR: disable ANSI color output (overridden by NNN_COLORS).

KNOWN ISSUES
nnn may not handle keypresses correctly when used with tmux (see issue #104 for more details). Set
TERM=xterm-256color to address it.

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

HOME
https://github.com/jarun/nnn

BSD Aug 18, 2020 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy