1NNN(1) BSD General Commands Manual NNN(1)
2
4 nnn — the missing terminal file manager for X
5
7 nnn [-a] [-A] [-b key] [-c] [-d] [-e] [-E] [-g] [-H] [-K] [-n] [-p file]
8 [-Q] [-r] [-R] [-s name] [-S] [-t secs] [-v] [-V] [-x] [-h] [PATH]
9
11 nnn (Nnn's Not Noice) is a performance-optimized, feature-packed fork of
12 noice (http://git.2f30.org/noice/) with seamless desktop integration,
13 simplified navigation, navigate-as-you-type mode with auto select, disk
14 usage analyzer mode, bookmarks, contexts, application launcher, familiar
15 navigation shortcuts, subshell spawning and much more.It remains a simple
16 and efficient file manager that stays out of your way.
17
18 nnn opens the current working directory by default if PATH is not speci‐
19 fied.
20
22 Press ? in nnn to see the list of keybinds.
23
25 nnn supports the following options:
26
27 -a
28 use access time for all operations (default: modification time)
29
30 -A
31 disable directory auto-select in navigate-as-you-type mode
32
33 -b key
34 specify bookmark key to open
35
36 -c
37 opener opens files in cli utilities only (overrides -e)
38
39 -d
40 detail mode
41
42 -e
43 open text files in $VISUAL (else $EDITOR, fallback vi) [prefer‐
44 ably CLI]
45
46 -E
47 use $EDITOR for internal undetached edits
48
49 -g
50 use regex filters instead of substring match
51
52 -H
53 show hidden files
54
55 -K
56 test for keybind collision
57
58 -n
59 start in navigate-as-you-type mode
60
61 -o
62 open files only on Enter key
63
64 -p file
65 copy (or pick) selection to file, or stdout if file='-'
66
67 -Q
68 disable confirmation on quit with multiple contexts active
69
70 -r
71 show cp, mv progress
72 (Linux-only, needs advcpmv; '^T' shows the progress on BSD/macOS)
73
74 -R
75 disable rollover at edges
76
77 -s name
78 load a session by name
79
80 -S
81 start in disk usage analyzer mode
82
83 -t secs
84 idle timeout in seconds to lock terminal
85
86 -v
87 use case-insensitive version compare to sort files
88
89 -V
90 show version and exit
91
92 -x
93 show notis on selection cp, mv, rm completion
94 copy path to system clipboard on select
95
96 -h
97 show program help and exit
98
100 There is no configuration file. Associated files are at
101
102 ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
103
104 Configuration is done using a few optional (set if you need) environment
105 variables. See ENVIRONMENT section.
106
107 nnn uses xdg-open (on Linux), open(1) (on macOS), cygstart on (Cygwin)
108 and open on (Haiku) as the desktop opener. It's also possible to specify
109 a custom opener. See ENVIRONMENT section.
110
112 Contexts serve the purpose of exploring multiple directories simultane‐
113 ously. 4 contexts are available. The status of the contexts are shown in
114 the top left corner:
115
116 - the current context is in reverse video
117 - other active contexts are underlined
118 - rest are inactive
119
120 On context creation, the state of the previous context is copied. Each
121 context remembers its last visited directory.
122
123 Each context can have its own directory color specified. See ENVIRONMENT
124 section.
125
127 Sessions are a way to save and restore states of work. A session stores
128 the settings and contexts.
129
130 Sessions can be loaded dynamically from within a running nnn instance, or
131 with a program option.
132
133 When a session is loaded dynamically, the last working session is saved
134 automatically to a dedicated -- "last session" -- session file.
135
136 All the session files are located by session name in the directory
137
138 ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions
139
140 "@" is the "last session" file.
141
143 Filters are strings to find matching entries in the current directory
144 instantly (search-as-you-type). There is a program option to switch to
145 regex filters. Matches are case-insensitive by default. In each context
146 the last filter is persisted at runtime or in saved sessions.
147
148 Special keys at empty filter prompt:
149
150 - toggle between string and regex: '/'
151 - toggle case sensitivity: ':'
152 - apply the last filter (or clear filter if non-empty): '^L'
153 - show help and config screen: '?'
154 - show command prompt: ']'
155 - launch an application: '='
156 - run a plugin by its key: ';'
157 - pin current directory: ','
158
159 Other noteworthy keys:
160
161 - '^char': usual keybind functionality
162 - 'Esc': exit filter prompt but skip dir refresh
163
164 Common regex use cases:
165
166 (1) To list all matches starting with the filter expression,
167 start the expression with a '^' (caret) symbol.
168 (2) Type '\.mkv' to list all MKV files.
169 (3) Use '.*' to match any character (sort of fuzzy search).
170
171 In the navigate-as-you-type mode directories are opened in filter mode,
172 allowing continuous navigation. Works best with the arrow keys.
173 When there's a unique match and it's a directory, nnn auto selects the
174 directory and enters it in this mode. Use the relevant program option to
175 disable this behaviour.
176
178 nnn allows file selection across directories and contexts!
179
180 There are 3 groups of keybinds to add files to selection:
181
182 (1) hovered file selection toggle (deselects if '+' is visible before the
183 entry, else adds to selection)
184 (2) add a range of files to selection (repeat the range key on the same
185 entry
186 twice to clear selection completely)
187 (3) add all files in the current directory to selection
188
189 A selection can be edited, copied, moved, removed, archived or linked.
190
191 Absolute paths of the selected files are copied to .selection file in the
192 config directory.
193
194 To edit the selection use the _edit selection_ key. Use this key to
195 remove a file from selection after you navigate away from its directory.
196 Editing doesn't end the selection mode. You can add more files to the
197 selection and edit the list again. If no file is selected in the current
198 session, this option attempts to list the selection file.
199
201 nnn can receive a list of files as input. The paths should be NUL-sepa‐
202 rated ('\0') but doesn't need to be NUL-terminated. Paths and can be rel‐
203 ative to the current directory or absolute.
204
205 Input is limited by 65,536 paths or 256 MiB of input.
206
207 Start nnn in this mode by writing to its standard input. So the output of
208 another command can be piped to it. For example, to list files in current
209 directory larger than 1M:
210
211 find -maxdepth 1 -size +1M -print0 | nnn
212
213 or you can redirect a list from a file:
214
215 nnn < files.txt
216
217 A temporary directory will be created containing symlinks to the given
218 paths. Any action performed on these symlinks will be performed only on
219 their targets, after which they might become invalid.
220
221 Though the term "files" is used, any input is valid as long as it's a
222 valid path. Invalid paths are ignored.
223
225 The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z,
226 Y (powers of 1024), same as the default units in ls.
227
229 The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables
230 are used. A single combination of arguments is supported for SHELL and
231 PAGER.
232
233 NNN_OPENER: specify a custom file opener.
234
235 export NNN_OPENER=nuke
236
237 NOTE: `nuke` is a file opener available in plugin repository
238
239 NNN_BMS: bookmark string as key_char:location pairs (max 10) separated by
240 ;:
241
242 export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
243
244 NOTE: To go to a bookmark, press the Lead key followed by the bookmark key.
245
246 NNN_PLUG: directly executable plugins as key_char:location pairs (max 15)
247 separated by ;:
248
249 export NNN_PLUG='o:fzopen;p:mocplay;d:diffs;m:nmount;t:imgthumb'
250
251 NOTES:
252 1. To run a plugin directly, press ; followed by the plugin key
253 2. To skip directory refresh after running a plugin, prefix with -
254
255 export NNN_PLUG='m:-mediainfo'
256
257 To assign keys to arbitrary non-background non-shell-interpreted cli
258 commands and invoke like plugins, add _ (underscore) before the
259 command.
260
261 export NNN_PLUG='x:_chmod +x $nnn;g:_git log;s:_smplayer $nnn;o:fzopen'
262
263 NOTES:
264 1. Use single quotes for $NNN_PLUG so $nnn is not interpreted
265 2. $nnn should be the last argument (IF used)
266 3. (Again) add _ before the command
267 4. To disable directory refresh after running a command as plugin,
268 prefix with -_
269 5. To skip user confirmation after command execution, suffix with *
270
271 export NNN_PLUG='y:-_sync*'
272
273 6. To run a GUI app as plugin, add a | after _
274
275 export NNN_PLUG='m:-_|mousepad $nnn'
276
277 EXAMPLES:
278 ----------------------------------- + -------------------------------------------------
279 Key:Command | Description
280 ----------------------------------- + -------------------------------------------------
281 k:-_fuser -kiv $nnn* | Interactively kill process(es) using hovered file
282 l:_git log | Show git log
283 n:-_vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
284 p:-_less -iR $nnn* | Page through hovered file in less
285 s:-_|smplayer -minigui $nnn | Play hovered media file, even unfinished download
286 x:_chmod +x $nnn | Make the hovered file executable
287 y:-_sync* | Flush cached writes
288 ----------------------------------- + -------------------------------------------------
289
290 NNN_COLORS: string of color codes for each context, e.g.:
291
292 export NNN_COLORS='1234'
293
294 codes: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
295
296 NNN_SSHFS: pass additional options to sshfs command:
297
298 export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
299
300 NOTE: The options must be preceded by `sshfs` and comma-separated without any space between them.
301
302 NNN_RCLONE: pass additional options to rclone command:
303
304 export NNN_RCLONE='rclone mount --read-only --no-checksum'
305
306 NOTE: The options must be preceded by `rclone` and max 5 flags are supported.
307
308 NNN_TRASH: trash (instead of delete) files to desktop Trash.
309
310 export NNN_TRASH=1
311
312 nnn: this is a special variable set to the hovered entry before executing
313 a command from the command prompt or spawning a shell.
314
316 nnn may not handle keypresses correctly when used with tmux (see issue
317 #104 for more details). Set TERM=xterm-256color to address it.
318
320 Arun Prakash Jana <engineerarun@gmail.com>,
321 Lazaros Koromilas <lostd@2f30.org>,
322 Dimitris Papastamos <sin@2f30.org>.
323
325 https://github.com/jarun/nnn
326
327BSD Feb 12, 2020 BSD