1MC(1) GNU Midnight Commander MC(1)
2
3
4
6 mc - Visual shell for Unix-like systems.
7
9 mc [-abcCdfhPstuUVx] [-l log] [dir1 [dir2]] [-e [file] ...] [-v file]
10
12 GNU Midnight Commander is a directory browser/file manager for
13 Unix-like operating systems.
14
16 -a, --stickchars
17 Disable usage of graphic characters for line drawing.
18
19 -b, --nocolor
20 Force black and white display.
21
22 -c, --color
23 Force color mode, please check the section Colors for more in‐
24 formation.
25
26 -C arg, --colors=arg
27 Specify a different color set in the command line. The format
28 of arg is documented in the Colors section.
29
30 --configure-options
31 Display configure options.
32
33 -d, --nomouse
34 Disable mouse support.
35
36 -e [file], --edit[=file]
37 Start the internal editor. If the file is specified, open it on
38 startup. See also mcedit (1).
39
40 -f, --datadir
41 Display the compiled-in search paths for Midnight Commander
42 files.
43
44 -F, --datadir-info
45 Display extended info about compiled-in paths for Midnight Com‐
46 mander.
47
48 -g, --oldmouse
49 Force a "normal tracking" mouse mode. Used when running on
50 xterm-capable terminals (tmux/screen).
51
52 -k, --resetsoft
53 Reset softkeys to their default from the termcap/terminfo data‐
54 base. Only useful on HP terminals when the function keys don't
55 work.
56
57 -K file, --keymap=file
58 Specify a name of keymap file in the command line.
59
60 -l file, --ftplog=file
61 Save the ftpfs dialog with the server in file.
62
63 --nokeymap
64 Don't load key bindings from any file, use default hardcoded
65 keys.
66
67 -P file, --printwd=file
68 Print the last working directory to the specified file. This
69 option is not meant to be used directly. Instead, it's used
70 from a special shell script that automatically changes the cur‐
71 rent directory of the shell to the last directory Midnight Com‐
72 mander was in. Source the file /usr/libexec/mc/mc.sh (bash and
73 zsh users) or /usr/libexec/mc.csh (tcsh users) respectively to
74 define mc as an alias to the appropriate shell script.
75
76 -s, --slow
77 Turn on the slow terminal mode, in this mode the program will
78 not draw expensive line drawing characters and will toggle ver‐
79 bose mode off.
80
81 -S arg, --skin=arg
82 Specify a name of skin in the command line. Technology of skins
83 is documented in the Skins section.
84
85 -t, --termcap
86 Used only if the code was compiled with S-Lang and terminfo: it
87 makes Midnight Commander use the value of the TERMCAP variable
88 for the terminal information instead of the information on the
89 system wide terminal database
90
91 -u, --nosubshell
92 Disable use of the concurrent shell (only makes sense if Mid‐
93 night Commander has been built with concurrent shell support).
94
95 -U, --subshell
96 Enable use of the concurrent shell support (only makes sense if
97 the Midnight Commander was built with the subshell support set
98 as an optional feature).
99
100 -v file, --view=file
101 Start the internal viewer to view the specified file. See also
102 mcview (1).
103
104 -V, --version
105 Display the version of the program.
106
107 -x, --xterm
108 Force xterm mode. Used when running on xterm-capable terminals
109 (two screen modes, and able to send mouse escape sequences).
110
111 -X, --no-x11
112 Do not use X11 to get the state of modifiers Alt, Ctrl, Shift
113
114 If both paths are specified, the first path name is the directory to
115 show in the active panel; the second path name is the directory to be
116 shown in the other panel.
117
118 If one path is specified, the path name is the directory to show in the
119 active panel; value of "other_dir" from panels.ini is the directory to
120 be shown in the passive panel.
121
122 If no paths are specified, current directory is shown in the active
123 panel; value of "other_dir" from panels.ini is the directory to be
124 shown in the passive panel.
125
127 The screen of Midnight Commander is divided into four parts. Almost
128 all of the screen space is taken up by two directory panels. By de‐
129 fault, the second line from the bottom of the screen is the shell com‐
130 mand line, and the bottom line shows the function key labels. The top‐
131 most line is the menu bar line. The menu bar line may not be visible,
132 but appears if you click the topmost line with the mouse or press the
133 F9 key.
134
135 Midnight Commander provides a view of two directories at the same time.
136 One of the panels is the current panel (a selection bar is in the cur‐
137 rent panel). Almost all operations take place on the current panel.
138 Some file operations like Rename and Copy by default use the directory
139 of the unselected panel as a destination (don't worry, they always ask
140 you for confirmation first). For more information, see the sections on
141 the Directory Panels, the Left and Right Menus and the File Menu.
142
143 You can execute system commands from Midnight Commander by simply typ‐
144 ing them. Everything you type will appear on the shell command line,
145 and when you press Enter, Midnight Commander will execute the command
146 line you typed; read the Shell Command Line and Input Line Keys sec‐
147 tions to learn more about the command line.
148
150 Midnight Commander comes with mouse support. It is activated whenever
151 you are running on an xterm(1) terminal (it even works if you take a
152 telnet, ssh or rlogin connection to another machine from the xterm) or
153 if you are running on a Linux console and have the gpm mouse server
154 running.
155
156 When you left click on a file in the directory panels, that file is se‐
157 lected; if you click with the right button, the file is marked (or un‐
158 marked, depending on the previous state).
159
160 Double-clicking on a file will try to execute the command if it is an
161 executable program; and if the extension file has a program specified
162 for the file's extension, the specified program is executed.
163
164 Also, it is possible to execute the commands assigned to the function
165 key labels by clicking on them.
166
167 The default auto repeat rate for the mouse buttons is 400 milliseconds.
168 This may be changed to other values by editing the ~/.config/mc/ini
169 file and changing the mouse_repeat_rate parameter.
170
171 If you are running Midnight Commander with the mouse support, you can
172 get the default mouse behavior (cutting and pasting text) by holding
173 down the Shift key.
174
175
177 Some commands in Midnight Commander involve the use of the Control
178 (sometimes labeled CTRL or CTL) and the Meta (sometimes labeled ALT or
179 even Compose) keys. In this manual we will use the following abbrevia‐
180 tions:
181
182 C-<chr>
183 means hold the Control key while typing the character <chr>.
184 Thus C-f would be: hold the Control key and type f.
185
186 Alt-<chr>
187 means hold the Meta or Alt key down while typing <chr>. If
188 there is no Meta or Alt key, type Esc, release it, then type the
189 character <chr>.
190
191 S-<chr>
192 means hold the Shift key down while typing <chr>.
193
194 All input lines in Midnight Commander use an approximation to the GNU
195 Emacs editor's key bindings (default).
196
197 You may redefine key bindings. See redefine hotkey bindings
198
199 for more info. All other key bindings (described in this manual) are
200 relative to default behavior.
201
202
203 There are many sections which tell about the keys. The following are
204 the most important.
205
206 The File Menu section documents the keyboard shortcuts for the commands
207 appearing in the File menu. This section includes the function keys.
208 Most of these commands perform some action, usually on the selected
209 file or the tagged files.
210
211 The Directory Panels section documents the keys which select a file or
212 tag files as a target for a later action (the action is usually one
213 from the file menu).
214
215 The Shell Command Line section list the keys which are used for enter‐
216 ing and editing command lines. Most of these copy file names and such
217 from the directory panels to the command line (to avoid excessive typ‐
218 ing) or access the command line history.
219
220 Input Line Keys are used for editing input lines. This means both the
221 command line and the input lines in the query dialogs.
222
223
224 Redefine hotkey bindings
225 Hotkey bindings may be read from external file (keymap-file). Ini‐
226 tially, Midnight Commander creates key bindings using keymap defined in
227 the source code. Then, two files /usr/share/mc/mc.keymap and
228 /etc/mc/mc.keymap are loaded always, sequentially reassigned key bind‐
229 ings defined earlier. User-defined keymap-file is searched on the fol‐
230 lowing algorithm (to the first one found):
231
232 1) command line option -K <keymap> or --keymap=<keymap>
233 2) Environment variable MC_KEYMAP
234 3) Parameter keymap in section [Midnight-Commander] of config
235 file.
236 4) File ~/.config/mc/mc.keymap
237
238 Command line option, environment variable and parameter in config file
239 may contain the absolute path to the keymap-file (with the extension
240 .keymap or without it). Search of keymap-file will occur in (to the
241 first one found):
242
243 1) ~/.config/mc
244 2) /etc/mc/
245 3) /usr/share/mc/
246
247
248 Miscellaneous Keys
249 Here are some keys which don't fall into any of the other categories:
250
251 Enter if there is some text in the command line (the one at the bottom
252 of the panels), then that command is executed. If there is no
253 text in the command line then if the selection bar is over a di‐
254 rectory the Midnight Commander does a chdir(2) to the selected
255 directory and reloads the information on the panel; if the se‐
256 lection is an executable file then it is executed. Finally, if
257 the extension of the selected file name matches one of the ex‐
258 tensions in the extensions file then the corresponding command
259 is executed.
260
261 C-l repaint all the information in Midnight Commander.
262
263 C-x c run the Chmod command on a file or on the tagged files.
264
265 C-x o run the Chown command on the current file or on the tagged
266 files.
267
268 C-x l run the hard link command.
269
270 C-x s run the absolute symbolic link command.
271
272 C-x v run the relative symbolic link command. See the File Menu sec‐
273 tion for more information about symbolic links.
274
275 C-x i set the other panel display mode to information.
276
277 C-x q set the other panel display mode to quick view.
278
279 C-x ! execute the External panelize command.
280
281 C-x h run the add directory to hotlist command.
282
283 Alt-! executes the Filtered view command, described in the view com‐
284 mand.
285
286 Alt-? executes the Find file command.
287
288 Alt-c pops up the quick cd dialog.
289
290 C-o when the program is being run in the Linux or FreeBSD console or
291 under an xterm, it will show you the output of the previous com‐
292 mand. When ran on the Linux console, Midnight Commander uses an
293 external program (cons.saver) to handle saving and restoring of
294 information on the screen.
295
296 When the subshell support is compiled in, you can type C-o at any time
297 and you will be taken back to Midnight Commander's main screen, to re‐
298 turn to your application just type C-o. If you have an application
299 suspended by using this trick, you won't be able to execute other pro‐
300 grams from Midnight Commander until you terminate the suspended appli‐
301 cation.
302
303 Directory Panels
304 This section lists the keys which operate on the directory panels. If
305 you want to know how to change the appearance of the panels take a look
306 at the section on Left and Right Menus.
307
308 Tab, C-i
309 change the current panel. The old other panel becomes the new
310 current panel and the old current panel becomes the new other
311 panel. The selection bar moves from the old current panel to the
312 new current panel.
313
314 Insert, C-t
315 to tag files you may use the Insert key (the kich1 terminfo se‐
316 quence). To untag files, just retag a tagged file.
317
318 Alt-e to change charset of panel you may use Alt-e (M-e). Recoding is
319 made from selected codepage into system codepage. To cancel the
320 recoding, select "No translation" in the dialog of encodings.
321
322 Alt-g, Alt-r, Alt-j
323 used to select the top file in a panel, the middle file and the
324 bottom one, respectively.
325
326 Alt-t toggle the current display listing to show the next display
327 listing format. With this it is possible to quickly switch to
328 brief listing, long listing, user defined listing format, and
329 back to the default.
330
331 C-\ (control-backslash)
332 show the directory hotlist and change to the selected directory.
333
334 + (plus)
335 this is used to select (tag) a group of files. Midnight Comman‐
336 der will prompt for a selection options. When Files only check‐
337 box is on, only files will be selected. If Files only is off,
338 as files as directories will be selected. When Shell Patterns
339 checkbox is on, the regular expression is much like the filename
340 globbing in the shell (* standing for zero or more characters
341 and ? standing for one character). If Shell Patterns is off,
342 then the tagging of files is done with normal regular expres‐
343 sions (see ed (1)). When Case sensitive checkbox is on, the se‐
344 lection will be case sensitive characters. If Case sensitive is
345 off, the case will be ignored.
346
347 \ (backslash)
348 use the "\" key to unselect a group of files. This is the oppo‐
349 site of the Plus key.
350
351 up-key, C-p
352 move the selection bar to the previous entry in the panel.
353
354 down-key, C-n
355 move the selection bar to the next entry in the panel.
356
357 home, a1, Alt-<
358 move the selection bar to the first entry in the panel.
359
360 end, c1, Alt->
361 move the selection bar to the last entry in the panel.
362
363 next-page, C-v
364 move the selection bar one page down.
365
366 prev-page, Alt-v
367 move the selection bar one page up.
368
369 Alt-o If the currently selected file is a directory, load that direc‐
370 tory on the other panel and moves the selection to the next
371 file. If the currently selected file is not a directory, load
372 the parent directory on the other panel and moves the selection
373 to the next file.
374
375 Alt-i make the current directory of the current panel also the current
376 directory of the other panel. Put the other panel to the list‐
377 ing mode if needed. If the current panel is panelized, the
378 other panel doesn't become panelized.
379
380 C-PageUp, C-PageDown
381 only when supported by the terminal: change to ".." and to the
382 currently selected directory respectively.
383
384 Alt-y moves to the previous directory in the history, equivalent to
385 clicking the < with the mouse.
386
387 Alt-u moves to the next directory in the history, equivalent to click‐
388 ing the > with the mouse.
389
390 Alt-S-h, Alt-H
391 displays the directory history, equivalent to depressing the 'v'
392 with the mouse.
393
394 Quick search
395 The Quick search mode allows you to perform fast file search in file
396 panel. Press C-s or Alt-s to start a filename search in the directory
397 listing.
398
399 When the search is active, the user input will be added to the search
400 string instead of the command line. If the Show mini-status option is
401 enabled the search string is shown on the mini-status line. When typ‐
402 ing, the selection bar will move to the next file starting with the
403 typed letters. The Backspace or DEL keys can be used to correct typing
404 mistakes. If C-s is pressed again, the next match is searched for.
405
406 If quick search is started with double pressing of C-s, the previous
407 quick search pattern will be used for current search.
408
409 Besides the filename characters, you can also use wildcard characters
410 '*' and '?'.
411
412 Shell Command Line
413 This section lists keys which are useful to avoid excessive typing when
414 entering shell commands.
415
416 Alt-Enter
417 copy the currently selected file name to the command line.
418
419 C-Enter
420 same a Alt-Enter. May not work on remote systems and some ter‐
421 minals.
422
423 C-S-Enter
424 copy the full path name of the currently selected file to the
425 command line. May not work on remote systems and some termi‐
426 nals.
427
428 Alt-Tab
429 does the filename, command, variable, username and hostname com‐
430 pletion for you.
431
432 C-x t, C-x C-t
433 copy the tagged files (or if there are no tagged files, the se‐
434 lected file) of the current panel (C-x t) or of the other panel
435 (C-x C-t) to the command line.
436
437 C-x p, C-x C-p
438 the first key sequence copies the current path name to the com‐
439 mand line, and the second one copies the unselected panel's path
440 name to the command line.
441
442 C-q the quote command can be used to insert characters that are oth‐
443 erwise interpreted by Midnight Commander (like the '+' symbol)
444
445 Alt-p, Alt-n
446 use these keys to browse through the command history. Alt-p
447 takes you to the last entry, Alt-n takes you to the next one.
448
449 Alt-h displays the history for the current input line.
450
451 General Movement Keys
452 The help viewer, the file viewer and the directory tree use common code
453 to handle moving. Therefore they accept exactly the same keys. Each of
454 them also accepts some keys of its own.
455
456 Other parts of Midnight Commander use some of the same movement keys,
457 so this section may be of use for those parts too.
458
459 Up, C-p
460 moves one line backward.
461
462 Down, C-n
463 moves one line forward.
464
465 Prev Page, Page Up, Alt-v
466 moves one page up.
467
468 Next Page, Page Down, C-v
469 moves one page down.
470
471 Home, A1
472 moves to the beginning.
473
474 End, C1
475 move to the end.
476
477 The help viewer and the file viewer accept the following keys in addi‐
478 tion the to ones mentioned above:
479
480 b, C-b, C-h, Backspace, Delete
481 moves one page up.
482
483 Space bar
484 moves one page down.
485
486 u, d moves one half of a page up or down.
487
488 g, G moves to the beginning or to the end.
489
490 Input Line Keys
491 The input lines (they are used for the command line and for the query
492 dialogs in the program) accept these keys:
493
494 C-a puts the cursor at the beginning of line.
495
496 C-e puts the cursor at the end of the line.
497
498 C-b, move-left
499 move the cursor one position left.
500
501 C-f, move-right
502 move the cursor one position right.
503
504 Alt-f moves one word forward.
505
506 Alt-b moves one word backward.
507
508 C-h, Backspace
509 delete the previous character.
510
511 C-d, Delete
512 delete the character in the point (over the cursor).
513
514 C-@ sets the mark for cutting.
515
516 C-w copies the text between the cursor and the mark to a kill buffer
517 and removes the text from the input line.
518
519 Alt-w copies the text between the cursor and the mark to a kill buf‐
520 fer.
521
522 C-y yanks back the contents of the kill buffer.
523
524 C-k kills the text from the cursor to the end of the line.
525
526 Alt-p, Alt-n
527 Use these keys to browse through the command history. Alt-p
528 takes you to the last entry, Alt-n takes you to the next one.
529
530 Alt-C-h, Alt-Backspace
531 delete one word backward.
532
533 Alt-Tab
534 does the filename, command, variable, username and hostname com‐
535 pletion for you.
536
537
539 The menu bar pops up when you press F9 or click the mouse on the top
540 row of the screen. The menu bar has five menus: "Left", "File", "Com‐
541 mand", "Options" and "Right".
542
543 The Left and Right Menus allow you to modify the appearance of the left
544 and right directory panels.
545
546 The File Menu lists the actions you can perform on the currently se‐
547 lected file or the tagged files.
548
549 The Command Menu lists the actions which are more general and bear no
550 relation to the currently selected file or the tagged files.
551
552 The Options Menu lists the actions which allow you to customize Mid‐
553 night Commander.
554
555 Left and Right (Above and Below) Menus
556 The outlook of the directory panels can be changed from the Left and
557 Right menus (they are named Above and Below when the horizontal panel
558 split is chosen from the Layout options dialog).
559
560 Listing Format...
561 The listing mode view is used to display a listing of files, there are
562 four different listing formats available: Full, Brief, Long and User.
563 The full directory view shows the file name, the size of the file and
564 the modification time.
565
566 The brief view shows only the file name and it has from 1 up to 9 col‐
567 umns (therefore showing more files unlike other views). The long view
568 is similar to the output of ls -l command. The long view takes the
569 whole screen width.
570
571 If you choose the "User" display format, then you have to specify the
572 display format.
573
574 The user display format must start with a panel size specifier. This
575 may be "half" or "full", and they specify a half screen panel and a
576 full screen panel respectively.
577
578 After the panel size, you may specify how many listings to fit in the
579 panel, side-by-side (in other words: how many times to repeat the
580 fields horizontally). This defaults to 1. You may change this by adding
581 a number from 1 to 9 to the format string.
582
583 After this you add the name of the fields with an optional size speci‐
584 fier. This are the available fields you may display:
585
586 name displays the file name.
587
588 size displays the file size.
589
590 bsize is an alternative form of the size format. It displays the size
591 of the files and for directories it just shows SUB-DIR or
592 UP--DIR.
593
594 type displays a one character wide type field. This character is
595 similar to what is displayed by ls with the -F flag - * for exe‐
596 cutable files, / for directories, @ for links, = for sockets, -
597 for character devices, + for block devices, | for pipes, ~ for
598 symbolic links to directories and ! for stale symlinks (links
599 that point nowhere).
600
601 mark an asterisk if the file is tagged, a space if it's not.
602
603 mtime file's last modification time.
604
605 atime file's last access time.
606
607 ctime file's status change time.
608
609 perm a string representing the current permission bits of the file.
610
611 mode an octal value with the current permission bits of the file.
612
613 nlink the number of links to the file.
614
615 ngid the GID (numeric).
616
617 nuid the UID (numeric).
618
619 owner the owner of the file.
620
621 group the group of the file.
622
623 inode the inode of the file.
624
625 Also you can use following keywords to define the panel layout:
626
627 space a space in the display format.
628
629 | add a vertical line to the display format.
630
631 To force one field to a fixed size (a size specifier), you just add :
632 followed by the number of characters you want the field to have. If
633 the number is followed by the symbol +, then the size specifies the
634 minimal field size - if the program finds out that there is more space
635 on the screen, it will then expand that field.
636
637 For example, the Full display corresponds to this format:
638
639 half type name | size | mtime
640
641 And the Long display corresponds to this format:
642
643 full perm space nlink space owner space group space size space mtime
644 space name
645
646 This is a nice user display format:
647
648 half name | size:7 | type mode:3
649
650 Panels may also be set to the following modes:
651
652 Info The info view display information related to the currently se‐
653 lected file and if possible information about the current file
654 system.
655
656 Tree The tree view is quite similar to the directory tree feature.
657 See the section about it for more information.
658
659 Quick View
660 In this mode, the panel will switch to a reduced viewer that
661 displays the contents of the currently selected file, if you se‐
662 lect the panel (with the tab key or the mouse), you will have
663 access to the usual viewer commands.
664
665 Sort Order...
666 The eight sort orders are by name, by extension, by modification time,
667 by access time, and by inode information modification time, by size, by
668 inode and unsorted. In the Sort order dialog box you can choose the
669 sort order and you may also specify if you want to sort in reverse or‐
670 der by checking the reverse box.
671
672 By default directories are sorted before files but this can be changed
673 from the Panel options menu (option Mix all files).
674
675 Filter...
676 The filter command allows you to specify a shell pattern (for example
677 *.tar.gz) which the files and directories must match to be shown. The
678 input line allow enter the pattern of file/directory names that will be
679 shown in the panel.
680
681 When Files only checkbox is on, only files will be matched to the fil‐
682 ter, and all directories will be shown. Otherwise, as files as directo‐
683 ries will be filtered. When Shell Patterns checkbox is on, the regular
684 expression is much like the filename globbing in the shell (* standing
685 for zero or more characters and ? standing for one character). Other‐
686 wise, the matching of files/directoris is done with normal regular ex‐
687 pressions (see ed(1)). When Case sensitive checkbox is on, the filter‐
688 ing will be case sensitive characters. Otherwise, the case will be ig‐
689 nored.
690
691 Reread
692 The reread command reload the list of files in the directory. It is
693 useful if other processes have created or removed files.
694
695 File Menu
696 Midnight Commander uses the F1 - F10 keys as keyboard shortcuts for
697 commands appearing in the file menu. The escape sequences for the
698 function keys are terminfo capabilities kf1 trough kf10. On terminals
699 without function key support, you can achieve the same functionality by
700 pressing the Esc key and then a number in the range 1 through 9 and 0
701 (corresponding to F1 to F9 and F10 respectively).
702
703 The File menu has the following commands (keyboard shortcuts in paren‐
704 theses):
705
706 Help (F1)
707
708 Invokes the built-in hypertext help viewer. Inside the help viewer, you
709 can use the Tab key to select the next link and the Enter key to follow
710 that link. The keys Space and Backspace are used to move forward and
711 backward in a help page. Press F1 again to get the full list of ac‐
712 cepted keys.
713
714 Menu (F2)
715
716 Invoke the user menu. The user menu provides an easy way to provide
717 users with a menu and add extra features to Midnight Commander.
718
719 View (F3, F13)
720
721 View the currently selected file. By default this invokes the Internal
722 File Viewer but if the option "Use internal view" is off, it invokes an
723 external file viewer specified by the VIEWER environment variable. If
724 VIEWER is undefined, the PAGER environment variable is tried. If PAGER
725 is also undefined, the "view" command is invoked. If you use F13 in‐
726 stead, the viewer will be invoked without doing any formatting or pre‐
727 processing to the file.
728
729 See parameters for external viewer for explain how you may specify an
730 extended command line options for external viewers.
731
732 Filtered View (Alt-!)
733
734 This command prompts for a command and its arguments (the argument de‐
735 faults to the currently selected file name), the output from such com‐
736 mand is shown in the internal file viewer.
737
738 Edit (F4, F14)
739
740 Press F4 to edit the highlighted file. Press F14 (usually F14) to
741 start the editor with a new, empty file. Currently they invoke the vi
742 editor, or the editor specified in the EDITOR environment variable, or
743 the Internal File Editor if the use_internal_edit option is on.
744
745 See parameters for external editor for explain how you may specify an
746 extended command line options for external editors.
747
748 Copy (F5, F15)
749
750 Press F5 to pop up an input dialog to copy the currently selected file
751 (or the tagged files, if there is at least one file tagged) to the di‐
752 rectory/filename you specify in the input dialog. The destination de‐
753 faults to the directory in the non-selected panel. Space for destina‐
754 tion file may be preallocated relative to preallocate_space configure
755 option. During this process, you can press C-c or Esc to abort the op‐
756 eration. For details about source mask (which will be usually either *
757 or ^\(.*\)$ depending on setting of Use shell patterns) and possible
758 wildcards in the destination see Mask copy/rename.
759
760 F15 (usually F15) is similar, but defaults to the directory in the se‐
761 lected panel. It always operates on the selected file, regardless of
762 any tagged files.
763
764 On some systems, it is possible to do the copy in the background by
765 clicking on the background button (or pressing Alt-b in the dialog
766 box). The Background Jobs is used to control the background process.
767
768 Link (C-x l)
769
770 Create a hard link to the current file.
771
772 Absolute symlink (C-x s)
773
774 Create a absolute symbolic link to the current file.
775
776 Relative symLink (C-x v)
777
778 Create a relative symbolic link to the current file.
779
780 To those of you who don't know what links are: creating a link to a
781 file is a bit like copying the file, but both the source filename and
782 the destination filename represent the same file image. For example, if
783 you edit one of these files, all changes you make will appear in both
784 files. Some people call links aliases or shortcuts.
785
786 A hard link appears as a real file. After making it, there is no way of
787 telling which one is the original and which is the link. If you delete
788 either one of them the other one is still intact. It is very difficult
789 to notice that the files represent the same image. Use hard links when
790 you don't even want to know.
791
792 A symbolic link is a reference to the name of the original file. If the
793 original file is deleted the symbolic link is useless. It is quite easy
794 to notice that the files represent the same image. Midnight Commander
795 shows an "@"-sign in front of the file name if it is a symbolic link to
796 somewhere (except to directory, where it shows a tilde (~)). The orig‐
797 inal file which the link points to is shown on mini-status line if the
798 Show mini-status option is enabled. Use symbolic links when you want to
799 avoid the confusion that can be caused by hard links.
800
801 When you press "C-x s" Midnight Commander will automatically fill in
802 the complete path+filename of the original file and suggest a name for
803 the link. You can change either one.
804
805 Sometimes you may want to change the absolute path of the original into
806 a relative path. An absolute path starts from the root directory:
807
808 /home/frodo/mc/mc -> /home/frodo/new/mc
809
810 A relative link describes the original file's location starting from
811 the location of the link itself:
812
813 /home/frodo/mc/mc -> ../new/mc
814
815 You can force Midnight Commander to suggest a relative path by pressing
816 "C-x v" instead of "C-x s".
817
818 Rename/Move (F6, F16)
819
820 Press F6 to pop up an input dialog to copy the currently selected file
821 (or the tagged files, if there is at least one file tagged) to the di‐
822 rectory/filename you specify in the input dialog. The destination de‐
823 faults to the directory in the non-selected panel. For more details
824 look at Copy (F5) operation above, most of the things are quite simi‐
825 lar.
826
827 F16 (usually F16) is similar, but defaults to the directory in the se‐
828 lected panel. It always operates on the selected file, regardless of
829 any tagged files.
830
831 On some systems, it is possible to do the copy in the background by
832 clicking on the background button (or pressing Alt-b in the dialog
833 box). The Background Jobs is used to control the background process.
834
835 Mkdir (F7)
836
837 Pop up an input dialog and creates the directory specified.
838
839 Delete (F8)
840
841 Delete the currently selected file or the tagged files in the currently
842 selected panel. During the process, you can press C-c or Esc to abort
843 the operation.
844
845 Quick cd (Alt-c) Use the quick cd command if you have full command line
846 and want to cd somewhere.
847
848 Select group (+)
849
850 This is used to select (tag) a group of files. Midnight Commander will
851 prompt for a selection options. When Files only checkbox is on, only
852 files will be selected. If Files only is off, as files as directories
853 will be selected. When Shell Patterns checkbox is on, the regular ex‐
854 pression is much like the filename globbing in the shell (* standing
855 for zero or more characters and ? standing for one character). If
856 Shell Patterns is off, then the tagging of files is done with normal
857 regular expressions (see ed (1)). When Case sensitive checkbox is on,
858 the selection will be case sensitive characters. If Case sensitive is
859 off, the case will be ignored.
860
861 Unselect group (\)
862
863 Used to unselect a group of files. This is the opposite of the Select
864 group command.
865
866 Quit (F10, S-F10)
867
868 Terminate Midnight Commander. S-F10 is used when you want to quit and
869 you are using the shell wrapper. S-F10 will not take you to the last
870 directory you visited with Midnight Commander, instead it will stay at
871 the directory where you started Midnight Commander.
872
873 Quick cd
874 This command is useful if you have a full command line and want to cd
875 somewhere without having to yank and paste the command line. This com‐
876 mand pops up a small dialog, where you enter everything you would enter
877 after cd on the command line and then you press enter. This features
878 all the things that are already in the internal cd command.
879
880 Command Menu
881 The Directory tree command shows a tree figure of the directories.
882
883 The "Find file" command allows you to search for a specific file.
884
885 The "Swap panels" command swaps the contents of the two directory pan‐
886 els.
887
888 The "Switch panels on/off" command shows the output of the last shell
889 command. This works only on xterm and on Linux and FreeBSD console.
890
891 The "Compare directories" command compares the directory panels with
892 each other. You can then use the Copy (F5) command to make the panels
893 identical. There are three compare methods. The quick method compares
894 only file size and file date. The thorough method makes a full
895 byte-by-byte compare. The thorough method is not available if the ma‐
896 chine does not support the mmap(2) system call. The size-only compare
897 method just compares the file sizes and does not check the contents or
898 the date times, it just checks the file size.
899
900 The "External panelize" allows you to execute an external program, and
901 make the output of that program the contents of the current panel.
902
903 The "Command history" command shows a list of typed commands. The se‐
904 lected command is copied to the command line. The command history can
905 also be accessed by typing Alt-p or Alt-n.
906
907 The "Directory hotlist" command makes changing of the current directory
908 to often used directories faster.
909
910 The "Screen list" command shows a dialog window with the list of cur‐
911 rently running internal editors, viewers and other MC modules that sup‐
912 port this mode.
913
914 The "Edit extension file" command allows you to specify programs to ex‐
915 ecuted when you try to execute, view, edit and do a bunch of other
916 thing on files with certain extensions (filename endings).
917
918 The "Edit Menu File" command may be used for editing the user menu
919 (which appears by pressing F2).
920
921 Directory Tree
922 The Directory Tree command shows a tree figure of the directories. You
923 can select a directory from the figure and Midnight Commander will
924 change to that directory.
925
926 There are two ways to invoke the tree. The real directory tree command
927 is available from Commands menu. The other way is to select tree view
928 from the Left or Right menu.
929
930 To get rid of long delays, Midnight Commander creates the tree figure
931 by scanning only a small subset of all the directories. If the direc‐
932 tory which you want to see is missing, move to its parent directory and
933 press C-r (or F2).
934
935 You can use the following keys:
936
937 General movement keys
938 are accepted.
939
940 Enter. In the directory tree, exits the directory tree and changes to
941 this directory in the current panel. In the tree view, changes
942 to this directory in the other panel and stays in tree view mode
943 in the current panel.
944
945 C-r, F2 (Rescan).
946 Rescan this directory. Use this when the tree figure is out of
947 date: it is missing subdirectories or shows some subdirectories
948 which don't exist any more.
949
950 F3 (Forget).
951 Delete this directory from the tree figure. Use this to remove
952 clutter from the figure. If you want the directory back to the
953 tree figure press F2 in its parent directory.
954
955 F4 (Static/Dynamic).
956 Toggle between the dynamic navigation mode (default) and the
957 static navigation mode.
958
959 In the static navigation mode you can use the Up and Down keys to se‐
960 lect a directory. All known directories are shown.
961
962 In the dynamic navigation mode you can use the Up and Down keys to se‐
963 lect a sibling directory, the Left key to move to the parent directory,
964 and the Right key to move to a child directory. Only the parent, sib‐
965 ling and children directories are shown, others are left out. The tree
966 figure changes dynamically as you traverse.
967
968 F5 (Copy).
969 Copy the directory.
970
971 F6 (RenMov).
972 Move the directory.
973
974 F7 (Mkdir).
975 Make a new directory below this directory.
976
977 F8 (Delete).
978 Delete this directory from the file system.
979
980 C-s, Alt-s.
981 Search the next directory matching the search string. If there
982 is no such directory these keys will move one line down.
983
984 C-h, Backspace.
985 Delete the last character of the search string.
986
987 Any other character.
988 Add the character to the search string and move to the next di‐
989 rectory which starts with these characters. In the tree view you
990 must first activate the search mode by pressing C-s. The search
991 string is shown in the mini status line.
992
993 The following actions are available only in the directory tree. They
994 aren't supported in the tree view.
995
996 F1 (Help).
997 Invoke the help viewer and show this section.
998
999 Esc, F10.
1000 Exit the directory tree. Do not change the directory.
1001
1002 The mouse is supported. A double-click behaves like Enter. See also the
1003 section on mouse support.
1004
1005 Find File
1006 The Find File feature first asks for the start directory for the search
1007 and the filename to be searched for. By pressing the Tree button you
1008 can select the start directory from the directory tree figure.
1009
1010 The "File name" input field contains a filename pattern to be searched
1011 for. It is interpreted as a shell pattern or as a regular expression
1012 depending on the state of the "Using shell patterns" checkbox. An empty
1013 value is valid and matches any file name.
1014
1015 The "Content" input field contains a string to search for within the
1016 files. Leave this field empty to disable searching file contents.
1017
1018 Option "Whole words" allows select only those files containing matches
1019 that form whole words. Like grep -w.
1020
1021 You can start the search by pressing the OK button. During the search
1022 you can stop from the Stop button and continue from the Start button.
1023
1024 You can browse the filelist with the up and down arrow keys. The Chdir
1025 button will change to the directory of the currently selected file. The
1026 Again button will ask for the parameters for a new search. The Quit
1027 button quits the search operation. The Panelize button will place the
1028 found files to the current directory panel so that you can do addi‐
1029 tional operations on them (view, copy, move, delete and so on). To re‐
1030 turn to the normal file listing, change directory to "..".
1031
1032 The 'Enable ignore directories' checkbox and input field below it allow
1033 one to set up the list of directories that should be skip during the
1034 search files (for example, you may want to avoid searches on a CD-ROM
1035 or on a NFS directory that is mounted across a slow link). List compo‐
1036 nents must be separated with a colon, here is an example:
1037
1038 /cdrom:/nfs/wuarchive:/afs
1039
1040 Relative paths are supported also. The following example shows how to
1041 skip special directories of version control systems:
1042 /cdrom:/nfs/wuarchive:/afs:.svn:.git:CVS
1043
1044 Attention: input field can contain a dot (.), this means the current
1045 absolute path.
1046
1047 You may consider using the External panelize command for some opera‐
1048 tions. Find file command is for simple queries only, while using Exter‐
1049 nal panelize you can do as mysterious searches as you would like.
1050
1051 External panelize
1052 The External panelize allows you to execute an external program, and
1053 make the output of that program the contents of the current panel.
1054
1055 For example, if you want to manipulate in one of the panels all the
1056 symbolic links in the current directory, you can use external paneliza‐
1057 tion to run the following command:
1058
1059 find . -type l -print
1060
1061 Upon command completion, the directory contents of the panel will no
1062 longer be the directory listing of the current directory, but all the
1063 files that are symbolic links.
1064
1065 If you want to panelize all of the files that have been downloaded from
1066 your FTP server, you can use this awk command to extract the file name
1067 from the transfer log files:
1068
1069 awk '$9 ~! /incoming/ { print $9 }' < /var/log/xferlog
1070
1071 You may want to save often used panelize commands under a descriptive
1072 name, so that you can recall them quickly. You do this by typing the
1073 command on the input line and pressing Add new button. Then you enter a
1074 name under which you want the command to be saved. Next time, you just
1075 choose that command from the list and do not have to type it again.
1076
1077 Hotlist
1078 The Directory hotlist command shows the labels of the directories in
1079 the directory hotlist. Midnight Commander will change to the directory
1080 corresponding to the selected label. From the hotlist dialog, you can
1081 remove already created label/directory pairs and add new ones. To add
1082 new directories quickly, you can use the Add to hotlist command (C-x
1083 h), which adds the current directory into the directory hotlist, asking
1084 just for the label for the directory.
1085
1086 This makes cd to often used directories faster. You may consider using
1087 the CDPATH variable as described in internal cd command description.
1088
1089 Edit Extension File
1090 This will invoke your editor on the file ~/.config/mc/mc.ext.ini. If
1091 this file does not exist and you are not root, it will be copied from
1092 /etc/mc/mc.ext.ini. If you are root, you can choose the file to edit:
1093 user's ~/.config/mc/mc.ext.ini or system-wide /etc/mc/mc.ext.ini. The
1094 format of this file is described in detail in it.
1095
1096 Background Jobs
1097 This lets you control the state of any background Midnight Commander
1098 process (only copy and move files operations can be done in the back‐
1099 ground). You can stop, restart and kill a background job from here.
1100
1101 Edit Menu File
1102 The user menu is a menu of useful actions that can be customized by the
1103 user. When you access the user menu, the file .mc.menu from the current
1104 directory is used if it exists, but only if it is owned by user or root
1105 and is not world-writable. If no such file found, ~/.config/mc/menu is
1106 tried in the same way, and otherwise mc uses the default system-wide
1107 menu /usr/share/mc/mc.menu.
1108
1109 The format of the menu file is very simple. Lines that start with any‐
1110 thing but space or tab are considered entries for the menu (in order to
1111 be able to use it like a hot key, the first character should be a let‐
1112 ter). All the lines that start with a space or a tab are the commands
1113 that will be executed when the entry is selected.
1114
1115 When an option is selected all the command lines of the option are
1116 copied to a temporary file in the temporary directory (usually
1117 /usr/tmp) and then that file is executed. This allows the user to put
1118 normal shell constructs in the menus. Also simple macro substitution
1119 takes place before executing the menu code. For more information, see
1120 macro substitution.
1121
1122 Here is a sample mc.menu file:
1123
1124 A Dump the currently selected file
1125 od -c %f
1126
1127 B Edit a bug report and send it to root
1128 I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1
1129 vi $I
1130 mail -s "Midnight Commander bug" root < $I
1131 rm -f $I
1132
1133 M Read mail
1134 emacs -f rmail
1135
1136 N Read Usenet news
1137 emacs -f gnus
1138
1139 H Call the info hypertext browser
1140 info
1141
1142 J Copy current directory to other panel recursively
1143 tar cf - . | (cd %D && tar xvpf -)
1144
1145 K Make a release of the current subdirectory
1146 echo -n "Name of distribution file: "
1147 read tar
1148 ln -s %d `dirname %d`/$tar
1149 cd ..
1150 tar cvhf ${tar}.tar $tar
1151
1152 = f *.tar.gz | f *.tgz & t n
1153 X Extract the contents of a compressed tar file
1154 tar xzvf %f
1155
1156 Default Conditions
1157
1158 Each menu entry may be preceded by a condition. The condition must
1159 start from the first column with a '=' character. If the condition is
1160 true, the menu entry will be the default entry.
1161
1162 Condition syntax: = <sub-cond>
1163 or: = <sub-cond> | <sub-cond> ...
1164 or: = <sub-cond> & <sub-cond> ...
1165
1166 Sub-condition is one of following:
1167
1168 y <pattern> syntax of current file matching pattern?
1169 (for edit menu only)
1170 f <pattern> current file matching pattern?
1171 F <pattern> other file matching pattern?
1172 d <pattern> current directory matching pattern?
1173 D <pattern> other directory matching pattern?
1174 t <type> current file of type?
1175 T <type> other file of type?
1176 x <filename> is it executable filename?
1177 ! <sub-cond> negate the result of sub-condition
1178
1179 Pattern is a normal shell pattern or a regular expression, according to
1180 the shell patterns option. You can override the global value of the
1181 shell patterns option by writing "shell_patterns=x" on the first line
1182 of the menu file (where "x" is either 0 or 1).
1183
1184 Type is one or more of the following characters:
1185
1186 n not a directory
1187 r regular file
1188 d directory
1189 l link
1190 c character device
1191 b block device
1192 f FIFO (pipe)
1193 s socket
1194 x executable file
1195 t tagged
1196
1197 For example 'rlf' means either regular file, link or fifo. The 't' type
1198 is a little special because it acts on the panel instead of the file.
1199 The condition '=t t' is true if there are tagged files in the current
1200 panel and false if not.
1201
1202 If the condition starts with '=?' instead of '=' a debug trace will be
1203 shown whenever the value of the condition is calculated.
1204
1205 The conditions are calculated from left to right. This means
1206 = f *.tar.gz | f *.tgz & t n
1207 is calculated as
1208 ( (f *.tar.gz) | (f *.tgz) ) & (t n)
1209
1210 Here is a sample of the use of conditions:
1211
1212 = f *.tar.gz | f *.tgz & t n
1213 L List the contents of a compressed tar-archive
1214 gzip -cd %f | tar xvf -
1215
1216 Addition Conditions
1217
1218 If the condition begins with '+' (or '+?') instead of '=' (or '=?') it
1219 is an addition condition. If the condition is true the menu entry will
1220 be included in the menu. If the condition is false the menu entry will
1221 not be included in the menu.
1222
1223 You can combine default and addition conditions by starting condition
1224 with '+=' or '=+' (or '+=?' or '=+?' if you want debug trace). If you
1225 want to use two different conditions, one for adding and another for
1226 defaulting, you can precede a menu entry with two condition lines, one
1227 starting with '+' and another starting with '='.
1228
1229 Comments are started with '#'. The additional comment lines must start
1230 with '#', space or tab.
1231
1232 Options Menu
1233 Midnight Commander has some options that may be toggled on and off in
1234 several dialogs which are accessible from this menu. Options are en‐
1235 abled if they have an asterisk or "x" in front of them.
1236
1237 The Configuration command pops up a dialog from which you can change
1238 most of settings of Midnight Commander.
1239
1240 The Layout command pops up a dialog from which you specify a bunch of
1241 options how mc looks like on the screen.
1242
1243 The Panel options command pops up a dialog from which you specify op‐
1244 tions of file manager panels.
1245
1246 The Confirmation command pops up a dialog from which you specify which
1247 actions you want to confirm.
1248
1249 The Appearance command pops up a dialog from which you specify the
1250 skin.
1251
1252 The Display bits command pops up a dialog from which you may select
1253 which characters is your terminal able to display.
1254
1255 The Learn keys command pops up a dialog from which you test some keys
1256 which are not working on some terminals and you may fix them.
1257
1258 The Virtual FS command pops up a dialog from which you specify some VFS
1259 related options.
1260
1261 The Save setup command saves the current settings of the Left, Right
1262 and Options menus. A small number of other settings is saved, too.
1263
1264 Configuration
1265 The options in this dialog are divided into several groups: "File oper‐
1266 ation options", "Esc key mode", "Pause after run" and "Other options".
1267
1268 File operation options
1269
1270 Verbose operation. This toggles whether the file Copy, Rename and
1271 Delete operations are verbose (i.e., display a dialog box for each op‐
1272 eration). If you have a slow terminal, you may wish to disable the ver‐
1273 bose operation. It is automatically turned off if the speed of your
1274 terminal is less than 9600 bps.
1275
1276 Compute totals. If this option is enabled, Midnight Commander computes
1277 total byte sizes and total number of files prior to any Copy, Rename
1278 and Delete operations. This will provide you with a more accurate
1279 progress bar at the expense of some speed. This option has no effect,
1280 if Verbose operation is disabled.
1281
1282 Classic progressbar. If this option is enabled, the progressbar of
1283 Copy/Move/Delete operations is always grown form left to right. If dis‐
1284 abled, the growing direction of progressbar follows to direction of
1285 Copy/Move/Delete operation: from left panel to right one and vice
1286 versa. Enabled by default.
1287
1288 Mkdir autoname. When you press F7 to create a new directory, the input
1289 line in popup dialog will be filled by name of current file or direc‐
1290 tory in active panel. Disabled by default.
1291
1292 Preallocate space. Preallocate space for whole target file, if possi‐
1293 ble, before copy operation. Disabled by default.
1294
1295 Esc key mode.
1296
1297 By default, Midnight Commander treats the Esc key as a key prefix.
1298 Therefore, you should press Esc code twice to exit a dialog. But there
1299 is a possibility to use a single press of Esc key for that action.
1300
1301 Single press. By default this option is disabled. If you'll enable it,
1302 the Esc key will act as a prefix key for set up time interval (see
1303 Timeout option below), and if no extra keys have arrived, then the Esc
1304 key is interpreted as a cancel key (Esc Esc).
1305
1306 Timeout. This options is used to setup the time interval (in microsec‐
1307 onds) for single press of Esc key. By default, this interval is one
1308 second (1000000 microseconds). Also the timeout can be set via KEY‐
1309 BOARD_KEY_TIMEOUT_US environment variable (also in microseconds), which
1310 has higher priority than Timeout option value.
1311
1312 Pause after run
1313
1314 After executing your commands, Midnight Commander can pause, so that
1315 you can examine the output of the command. There are three possible
1316 settings for this variable:
1317
1318 Never. Means that you do not want to see the output of your command.
1319 If you are using the Linux or FreeBSD console or an xterm, you will be
1320 able to see the output of the command by typing C-o.
1321
1322 On dumb terminals. You will get the pause message on terminals that
1323 are not capable of showing the output of the last command executed (any
1324 terminal that is not an xterm or the Linux console).
1325
1326 Always. The program will pause after executing all of your commands.
1327
1328 Other options
1329
1330 Use internal editor. If this option is enabled, the built-in file edi‐
1331 tor is used to edit files. If the option is disabled, the editor speci‐
1332 fied in the EDITOR environment variable is used. If no editor is spec‐
1333 ified, vi is used. See the section on the internal file editor.
1334
1335 Use internal viewer. If this option is enabled, the built-in file
1336 viewer is used to view files. If the option is disabled, the pager
1337 specified in the PAGER environment variable is used. If no pager is
1338 specified, the view command is used. See the section on the internal
1339 file viewer.
1340
1341 Ask new file name. If this option is enabled, file name is asked be‐
1342 fore open new file in editor.
1343
1344 Auto menus. If this option is enabled, the user menu will be invoked
1345 at startup. Useful for building menus for non-unixers.
1346
1347 Drop down menus. When this option is enabled, the pull down menus will
1348 be activated as soon as you press the F9 key. Otherwise, you will only
1349 get the menu title, and you will have to activate the menu either with
1350 the arrow keys or with the hotkeys. It is recommended if you are using
1351 hotkeys.
1352
1353 Shell Patterns. By default the Select, Unselect and Filter commands
1354 will use shell-like regular expressions. The following conversions are
1355 performed to achieve this: the '*' is replaced by '.*' (zero or more
1356 characters); the '?' is replaced by '.' (exactly one character) and
1357 '.' by the literal dot. If the option is disabled, then the regular ex‐
1358 pressions are the ones described in ed(1).
1359
1360 Complete: show all. By default, Midnight Commander pops up all possi‐
1361 ble completions if the completion is ambiguous only when you press
1362 Alt-Tab for the second time. For the first time, it just completes as
1363 much as possible and beeps in the case of ambiguity. Enable this op‐
1364 tion if you want to see all possible completions even after pressing
1365 Alt-Tab the first time.
1366
1367 Rotating dash. If this option is enabled, the Midnight Commander shows
1368 a rotating dash in the upper right corner as a work in progress indica‐
1369 tor.
1370
1371 Cd follows links. This option, if set, causes Midnight Commander to
1372 follow the logical chain of directories when changing current directory
1373 either in the panels, or using the cd command. This is the default be‐
1374 havior of bash. When unset, Midnight Commander follows the real direc‐
1375 tory structure, so cd .. if you've entered that directory through a
1376 link will move you to the current directory's real parent and not to
1377 the directory where the link was present.
1378
1379 Safe delete. If this option is enabled, deleting files and directory
1380 hotlist entries unintentionally becomes more difficult. The default
1381 selection in the confirmation dialogs for deletion changes from Yes to
1382 No. This option is disabled by default.
1383
1384 Safe overwrite. If this option is enabled, overwriting files uninten‐
1385 tionally becomes more difficult. The default selection in the over‐
1386 write confirmation dialog changes from Yes to No. This option is dis‐
1387 abled by default.
1388
1389 Auto save setup. If this option is enabled, when you exit Midnight
1390 Commander, the configurable options of Midnight Commander are saved in
1391 the ~/.config/mc/ini file.
1392
1393 Layout
1394 The layout dialog gives you a possibility to change the general layout
1395 of screen. The options in this dialog are divided into several groups:
1396 "Panel split", "Console output" and "Other options".
1397
1398 Panel split
1399
1400 The rest of the screen area is used for the two directory panels. You
1401 can specify whether the area is split to the panels in Vertical or Hor‐
1402 izontal direction. Panel layout can be changed using Alt-, (Alt-comma)
1403 shortcut.
1404
1405 Equal split. By default, panels have equal sizes. Using this option
1406 you can specify an unequal split.
1407
1408 Console output
1409
1410 On the Linux or FreeBSD console you can specify how many lines are
1411 shown in the output window. This option is available if Midnight Com‐
1412 mander runs on native console only.
1413
1414 Other options
1415
1416 Menu bar visible. If enabled, main menu of Midnight Commander is al‐
1417 ways visible on the top row of screen above panels. Enabled by default.
1418
1419 Command prompt. If enabled, command line is available. Enabled by de‐
1420 fault.
1421
1422 Keybar visible. If enabled, 10 labels associated with F1-F10 keys are
1423 located at the bottom row of screen. Enabled by default.
1424
1425 Hintbar visible. If enabled, the one-line hints are visible below pan‐
1426 els. Enabled by default.
1427
1428 XTerm window title. When run in a terminal emulator for X11, Midnight
1429 Commander sets the terminal window title to the current working direc‐
1430 tory and updates it when necessary. If your terminal emulator is bro‐
1431 ken and you see some incorrect output on startup and directory change,
1432 turn off this option. Enabled by default.
1433
1434 Show free space. If enabled, free space and total space of current
1435 file system is shown at the bottom frame of panel. Enabled by default.
1436
1437 Panel options
1438 Main panel options
1439
1440 Show mini-status. If enabled, one line of status information about the
1441 currently selected item is shown at the bottom of the panels. Enabled
1442 by default.
1443
1444 Use SI size units. If this option is enabled, Midnight Commander will
1445 use SI prefixes (base 10) when displaying any byte sizes. If disabled
1446 (default), Midnight Commander will use IEC prefixes (base 2).
1447
1448 Mix all files. If this option is enabled, all files and directories
1449 are shown mixed together. If the option is disabled (default), direc‐
1450 tories (and links to directories) are shown at the beginning of the
1451 listing, and other files below.
1452
1453 Show backup files. If enabled, Midnight Commander will show files end‐
1454 ing with a tilde. Otherwise, they won't be shown (like GNU's ls option
1455 -B). Enabled by default.
1456
1457 Show hidden files. If enabled, Midnight Commander will show all files
1458 that start with a dot (like ls -a). Disabled by default.
1459
1460 Fast directory reload. If this option is enabled, Midnight Commander
1461 will use a trick to determine if the directory contents have changed.
1462 The trick is to reload the directory only if the i-node of the direc‐
1463 tory has changed; this means that reloads only happen when files are
1464 created or deleted. If what changes is the i-node for a file in the
1465 directory (file size changes, mode or owner changes, etc) the display
1466 is not updated. In these cases, if you have the option on, you have to
1467 rescan the directory manually (with C-r). Disabled by default.
1468
1469 Mark moves down. If enabled, the selection bar will move down when you
1470 mark a file (with Insert key). Enabled by default.
1471
1472 Reverse files only. Allow revert selection of files only. Enabled by
1473 default. If enabled, the reverse selection is applied to files only,
1474 not to directories. The selection of directories is untouched. If off,
1475 the reverse selection is applied to files as well to directories: all
1476 unselected items become selected, and vice versa.
1477
1478 Simple swap. If both panels contain file listing, simple swap means
1479 that panels exchange its screen positions: left panel become right one,
1480 and vice versa. If this option is unchecked, file listing panels ex‐
1481 change its content keeping listing format and sort options. Unchecked
1482 by default.
1483
1484 Auto save panels setup. If this option is enabled, when you exit Mid‐
1485 night Commander, the current settings of panels are saved in the
1486 ~/.config/mc/panels.ini file. Disabled by default.
1487
1488 Navigation
1489
1490 Lynx-like motion. If this option is enabled, you may use the arrows
1491 keys to automatically chdir if the current selection is a subdirectory
1492 and the shell command line is empty. By default, this setting is off.
1493
1494 Page scrolling. If set (the default), panel will scroll by half the
1495 display when the cursor reaches the end or the beginning of the panel,
1496 otherwise it will just scroll a file at a time.
1497
1498 Center scrolling. If set, panel will scroll when the cursor reaches
1499 the middle of the panel column, only hitting the top or bottom of the
1500 panel when actually on the first or last file. This behavior applies
1501 when scrolling one file at a time, and does not apply to the page
1502 up/down keys.
1503
1504 Mouse page scrolling. Controls whenever scrolling with the mouse wheel
1505 is done by pages or line by line on the panels.
1506
1507 File highlight
1508
1509 You can specify whether permissions and file types should be high‐
1510 lighted with distinctive Colors. If the permission highlighting is en‐
1511 abled, the parts of the perm and mode display fields which apply to the
1512 user running Midnight Commander are highlighted with the color defined
1513 by the selected keyword. If the file type highlighting is enabled,
1514 file names are colored according to rules described in /etc/mc/file‐
1515 highlight.ini file. See Filenames Highlight for more info.
1516
1517 Quick search
1518
1519 You can specify how the Quick search mode should work: case insensi‐
1520 tively, case sensitively or be matched to the panel sort order: case
1521 sensitive or not.
1522
1523 Confirmation
1524 In this dialog you configure the confirmation options for file dele‐
1525 tion, overwriting files, execution by pressing enter, quitting the pro‐
1526 gram, directory hotlist entries deletion and history cleanup.
1527
1528 Appearance
1529 In this dialog you can select the skin to be used and enable shadow for
1530 dialogs and drop down menus.
1531
1532 See the Skins section for technical details about the skin definition
1533 files.
1534
1535 Shadows. If this option is enabled, all dialogs and drop down menus
1536 will have a shadow.
1537
1538 Display bits
1539 This is used to configure the range of visible characters on the
1540 screen. This setting may be 7-bits if your terminal/curses supports
1541 only seven output bits, ISO-8859-1 displays all the characters in the
1542 ISO-8859-1 map and full 8 bits is for those terminals that can display
1543 full 8 bit characters.
1544
1545 Learn keys
1546 This dialog allows you to test and redefine functional keys, cursor ar‐
1547 rows and some other keys to make them work properly on your terminal.
1548 They often don't, since many terminal databases are incomplete or bro‐
1549 ken.
1550
1551 You can move around with the Tab key and with the vi moving keys ('h'
1552 left, 'j' down, 'k' up and 'l' right). Once you press any cursor move‐
1553 ment key and it is recognized, you can use that key as well.
1554
1555 You can test keys just by pressing each of them. When you press a key
1556 and it is recognized properly, OK should appear next to the name of
1557 that key. Once a key is marked OK it starts working as usually, e.g.
1558 F1 pressed the first time will just check that the F1 key works, but
1559 after that it will show help. The same applies to the arrow keys. The
1560 Tab key should be working always.
1561
1562 If some keys do not work properly then you won't see OK appear after
1563 pressing one of these. Then you may want to redefine it. Do it by
1564 pressing the button with the name of that key (either by the mouse or
1565 by Enter or Space after selecting the button with Tab or arrows). Then
1566 a message box will appear asking you to press that key. Do it and wait
1567 until the message box disappears. If you want to abort, just press Es‐
1568 cape once and wait.
1569
1570 When you finish with all the keys, you can Save them. The definitions
1571 for the keys you have redefined will be written into the [termi‐
1572 nal:TERM] section of your ~/.config/mc/ini file (where TERM is the name
1573 of your current terminal). The definitions of the keys that were al‐
1574 ready working properly are not saved.
1575
1576 Virtual FS
1577 This option gives you control over the settings of the Virtual File
1578 System.
1579
1580 Midnight Commander keeps in memory the information related to some of
1581 the virtual file systems to speed up the access to the files in the
1582 file system (for example, directory listings fetched from FTP servers).
1583
1584 Also, in order to access the contents of compressed files (for example,
1585 compressed tar files), Midnight Commander needs to create temporary un‐
1586 compressed files on your disk.
1587
1588 Since both the information in memory and the temporary files on disk
1589 take up resources, you may want to tune the parameters of the cached
1590 information to decrease your resource usage or to maximize the speed of
1591 access to frequently used file systems.
1592
1593 Because of the format of the tar archives, the Tar filesystem needs to
1594 read the whole file just to load the file entries. Since most tar
1595 files are usually kept compressed (plain tar files are species in ex‐
1596 tinction), the tar file system has to uncompress the file on the disk
1597 in a temporary location and then access the uncompressed file as a reg‐
1598 ular tar file.
1599
1600 Now, since we all love to browse files and tar files all over the disk,
1601 it's common that you will leave a tar file and then re-enter it later.
1602 Since decompression is slow, Midnight Commander will cache the informa‐
1603 tion in memory for a limited time. When the timeout expires, all the
1604 resources associated with the file system are released. The default
1605 timeout is set to one minute.
1606
1607 The FTP File System (ftpfs) allows you to browse directories on remote
1608 FTP servers. It has several options.
1609
1610 ftp anonymous password is the password used when you login as "anony‐
1611 mous". Some sites require a valid e-mail address. On the other hand,
1612 you probably don't want to give your real e-mail address to untrusted
1613 sites, especially if you are not using spam filtering.
1614
1615 ftpfs keeps the directory listing it fetches from a FTP server in a
1616 cache. The cache expire time is configurable with the ftpfs directory
1617 cache timeout option. A low value for this option may slow down every
1618 operation on the ftpfs because every operation would require sending a
1619 request to the FTP server.
1620
1621 You can define an FTP proxy host for doing FTP. Note that most modern
1622 firewalls are fully transparent at least for passive FTP (see below),
1623 so FTP proxies are considered obsolete.
1624
1625 If Always use ftp proxy is not set, you can use the exclamation sign to
1626 enable proxy for certain hosts. See FTP File System for examples.
1627
1628 If this option is set, the program will do two things: consult the
1629 /etc/mc/mc.no_proxy file for lines containing host names that are local
1630 (if the host name starts with a dot, it is assumed to be a domain) and
1631 to assume that any hostnames without dots in their names are directly
1632 accessible. All other hosts will be accessed through the specified FTP
1633 proxy.
1634
1635 You can enable using ~/.netrc file, which keeps login names and pass‐
1636 words for ftp servers. See netrc (5) for the description of the .netrc
1637 format.
1638
1639 Use passive mode enables using FTP passive mode, when the connection
1640 for data transfer is initiated by the client, not by the server. This
1641 option is recommended and enabled by default. If this option is turned
1642 off, the data connection is initiated by the server. This may not work
1643 with some firewalls.
1644
1645 Save Setup
1646 At startup, Midnight Commander tries to load initialization information
1647 from the ~/.config/mc/ini file. If this file doesn't exist, the sys‐
1648 tem-wide file /etc/mc/mc.ini is used. If this file doesn't exist, the
1649 system-wide file /usr/share/mc/mc.ini is used. If this file doesn't ex‐
1650 ist, MC uses the default settings.
1651
1652 The Save Setup command creates the ~/.config/mc/ini file by saving the
1653 current settings of the Left, Right and Options menus.
1654
1655 If you activate the auto save setup option, MC will always save the
1656 current settings when exiting.
1657
1658 There also exist settings which can't be changed from the menus. To
1659 change these settings you have to edit the setup file with your fa‐
1660 vorite editor. See the section on Special Settings for more informa‐
1661 tion.
1662
1663
1665 You may execute commands by typing them directly in Midnight Comman‐
1666 der's input line, or by selecting the program you want to execute with
1667 the selection bar in one of the panels and hitting Enter.
1668
1669 If you press Enter over a file that is not executable, Midnight Comman‐
1670 der checks the extension of the selected file against the extensions in
1671 the Extensions File. If a match is found then the code associated with
1672 that extension is executed. A very simple macro expansion takes place
1673 before executing the command.
1674
1675 The cd internal command
1676 The cd command is interpreted by Midnight Commander, it is not passed
1677 to the command shell for execution. Thus it may not handle all of the
1678 nice macro expansion and substitution that your shell does, although it
1679 does some of them:
1680
1681 Tilde substitution. The (~) will be substituted with your home direc‐
1682 tory, if you append a username after the tilde, then it will be substi‐
1683 tuted with the login directory of the specified user.
1684
1685 For example, ~guest is the home directory for the user guest, while
1686 ~/guest is the directory guest in your home directory.
1687
1688 Previous directory. You can jump to the directory you were previously
1689 by using the special directory name '-' like this: cd -
1690
1691 CDPATH directories. If the directory specified to the cd command is
1692 not in the current directory, then Midnight Commander uses the value in
1693 the environment variable CDPATH to search for the directory in any of
1694 the named directories.
1695
1696 For example you could set your CDPATH variable to ~/src:/usr/src, al‐
1697 lowing you to change your directory to any of the directories inside
1698 the ~/src and /usr/src directories, from any place in the file system
1699 by using its relative name (for example cd linux could take you to
1700 /usr/src/linux).
1701
1702 Macro Substitution
1703 When accessing a user menu, or executing an extension dependent com‐
1704 mand, or running a command from the command line input, a simple macro
1705 substitution takes place.
1706
1707 The macros are:
1708
1709 %i The indent of blank space, equal the cursor column position.
1710 For edit menu only.
1711
1712 %y The syntax type of current file. For edit menu only.
1713
1714 %k The block file name.
1715
1716 %e The error file name.
1717
1718 %m The current menu name.
1719
1720 %f and %p
1721 In file manager user menu: the current file name in selected
1722 panel. In mcedit user menu: the name of opened file.
1723
1724 %x The extension of current file name.
1725
1726 %b The current file name without extension.
1727
1728 %d The current directory name.
1729
1730 %F The current file in the unselected panel.
1731
1732 %D The directory name of the unselected panel.
1733
1734 %t The currently tagged files.
1735
1736 %T The tagged files in the unselected panel.
1737
1738 %u and %U
1739 Similar to the %t and %T macros, but in addition the files are
1740 untagged. You can use this macro only once per menu file entry
1741 or extension file entry, because next time there will be no
1742 tagged files.
1743
1744 %s and %S
1745 The selected files: The tagged files if there are any. Otherwise
1746 the current file.
1747
1748 %cd This is a special macro that is used to change the current di‐
1749 rectory to the directory specified in front of it. This is used
1750 primarily as an interface to the Virtual File System.
1751
1752 %view This macro is used to invoke the internal viewer. This macro
1753 can be used alone, or with arguments. If you pass any arguments
1754 to this macro, they should be enclosed in brackets.
1755
1756 The arguments are: ascii to force the viewer into ascii mode;
1757 hex to force the viewer into hex mode; nroff to tell the viewer
1758 that it should interpret the bold and underline sequences of
1759 nroff; unformatted to tell the viewer to not interpret nroff
1760 commands for making the text bold or underlined.
1761
1762 %% The % character
1763
1764 %{some text}
1765 Prompt for the substitution. An input box is shown and the text
1766 inside the braces is used as a prompt. The macro is substituted
1767 by the text typed by the user. The user can press Esc or F10 to
1768 cancel. This macro doesn't work on the command line yet.
1769
1770 %var{ENV:default}
1771 If environment variable ENV is unset, the default is substi‐
1772 tuted. Otherwise, the value of ENV is substituted.
1773
1774 The subshell support
1775 The subshell support is a compile time option, that works with the
1776 shells: bash, ash (BusyBox and Debian), tcsh, zsh and fish.
1777
1778 When the subshell support is active, Midnight Commander will spawn a
1779 concurrent copy of your shell (the one defined in the SHELL variable
1780 and if it is not defined, then the one in the /etc/passwd file) and run
1781 it in a pseudo terminal, instead of invoking a new shell each time you
1782 execute a command, the command will be passed to the subshell as if you
1783 had typed it. This also allows you to change the environment vari‐
1784 ables, use shell functions and define aliases that are valid until you
1785 quit Midnight Commander.
1786
1787 bash users may specify startup commands in ~/.local/share/mc/bashrc
1788 (fallback ~/.bashrc) and special keyboard maps in ~/.local/share/mc/in‐
1789 putrc (fallback ~/.inputrc).
1790
1791 ash/dash users (BusyBox or Debian) may specify startup commands in
1792 ~/.local/share/mc/ashrc (fallback ~/.profile).
1793
1794 zsh users may specify startup commands in ~/.local/share/mc/.zshrc
1795 (fallback ~/.zshrc).
1796
1797 tcsh, fish users cannot specify mc-specific startup commands at
1798 present. They have to rely on shell-specific startup files.
1799
1800 The following paragraphs are relevant only when the subshell support is
1801 active:
1802
1803 You can suspend applications at any time with the sequence C-o and jump
1804 back to Midnight Commander, if you interrupt an application, you will
1805 not be able to run other external commands until you quit the applica‐
1806 tion you interrupted.
1807
1808 The basic prompt displayed by Midnight Commander is of the form
1809 "user@host:current_path$ ". When using a capable shell, like Bash, the
1810 prompt displayed by Midnight Commander will be the same prompt that you
1811 are currently using in your shell.
1812
1813 (There's a known problem when using fish: the prompt is displayed only
1814 in full screen mode (Ctrl-o), not when the panels are visible.)
1815
1816 The OPTIONS section has more information on how you can control sub‐
1817 shell usage (-U/-u). Furthermore, to set a specific subshell different
1818 from your current SHELL variable or login shell defined in /etc/passwd,
1819 you may call MC like this: SHELL=/bin/myshell mc
1820
1822 The Chmod window is used to change the attribute bits in a group of
1823 files and directories. It can be invoked with the C-x c key combina‐
1824 tion.
1825
1826 The Chmod window has two parts - Permissions and File.
1827
1828 In the File section are displayed the name of the file or directory and
1829 its permissions in octal form, as well as its owner and group.
1830
1831 In the Permissions section there is a set of check buttons which corre‐
1832 spond to the file attribute bits. As you change the attribute bits,
1833 you can see the octal value change in the File section.
1834
1835 To move between the widgets (buttons and check buttons) use the arrow
1836 keys or the Tab key. To change the state of the check buttons or to
1837 select a button use Space. You can also use the hotkeys on the buttons
1838 to quickly activate them. Hotkeys are shown as highlighted letters on
1839 the buttons.
1840
1841 To set the attribute bits, use the Enter key.
1842
1843 When working with a group of files or directories, you just click on
1844 the bits you want to set or clear. Once you have selected the bits you
1845 want to change, you select one of the action buttons (Set marked or
1846 Clear marked).
1847
1848 Finally, to set the attributes exactly to those specified, you can use
1849 the [Set all] button, which will act on all the tagged files.
1850
1851 [Marked all] set only marked attributes to all selected files
1852
1853 [Set marked] set marked bits in attributes of all selected files
1854
1855 [Clean marked] clear marked bits in attributes of all selected files
1856
1857 [Set] set the attributes of one file
1858
1859 [Cancel] cancel the Chmod command
1860
1862 The Chown command is used to change the owner/group of a file. The hot
1863 key for this command is C-x o.
1864
1866 The Advanced Chown command is the Chmod and Chown command combined into
1867 one window. You can change the permissions and owner/group of files at
1868 once.
1869
1871 The Chattr window is used to change the attributes of a group of files
1872 and directories on a Linux file system. It can be invoked with the C-x
1873 e key combination.
1874
1875 Not all attributes are supported or utilized by all filesystems. List
1876 of available attribute flags is represented as a set of check buttons
1877 which correspond to the attribute flags (see chattr(1) for details). As
1878 you change the attribute flags, you can see the symbolic value change
1879 below file name.
1880
1881 To move between the widgets (buttons and check buttons) use the arrow
1882 keys or the Tab key. To change the state of the check buttons or to se‐
1883 lect a button use Space.
1884
1885 To set the attributes, use the Enter key.
1886
1887 When working with a group of files or directories, you just click on
1888 the flags you want to set or clear. Once you have selected the flags
1889 you want to change, you select one of the action buttons (Set marked or
1890 Clear marked).
1891
1892 Finally, to set the attributes exactly to those specified, you can use
1893 the [Set all] button, which will act on all the tagged files.
1894
1895 [Marked all] set only marked attributes to all selected files.
1896
1897 [Set marked] set marked flags in attributes of all selected files.
1898
1899 [Clean marked] clear marked flags in attributes of all selected files.
1900
1901 [Set] set the attributes of one file.
1902
1903 [Cancel] cancel the Chattr command.
1904
1906 When you copy, move or delete files, Midnight Commander shows the file
1907 operations dialog. It shows the files currently being processed and
1908 uses up to three progress bars. The file bar indicates the percentage
1909 of the current file that has been processed so far. The count bar
1910 shows how many of the tagged files have been handled. The bytes bar
1911 indicates the percentage of the total size of the tagged files that has
1912 been handled. If the verbose option is off, the file and bytes bars
1913 are not shown.
1914
1915 There are two buttons at the bottom of the dialog. Pressing the Skip
1916 button will skip the rest of the current file. Pressing the Abort but‐
1917 ton will abort the whole operation, the rest of the files are skipped.
1918
1919 There are three other dialogs which you can run into during the file
1920 operations.
1921
1922 The error dialog informs about error conditions and has three choices.
1923 Normally you select either the Skip button to skip the file or the
1924 Abort button to abort the operation altogether. You can also select
1925 the Retry button if you fixed the problem from another terminal.
1926
1927 The replace dialog is shown when you attempt to copy or move a file on
1928 the top of an existing file. The dialog shows the dates and sizes of
1929 the both files. Press the Yes button to overwrite the file, the No
1930 button to skip the file, the All button to overwrite all the files, the
1931 None button to never overwrite and the Update button to overwrite if
1932 the source file is newer than the target file. You can abort the whole
1933 operation by pressing the Abort button.
1934
1935 The recursive delete dialog is shown when you try to delete a directory
1936 which is not empty. Press the Yes button to delete the directory re‐
1937 cursively, the No button to skip the directory, the All button to
1938 delete all the directories and the None button to skip all the
1939 non-empty directories. You can abort the whole operation by pressing
1940 the Abort button. If you selected the Yes or All button you will be
1941 asked for a confirmation. Type "yes" only if you are really sure you
1942 want to do the recursive delete.
1943
1944 If you have tagged files and perform an operation on them only the
1945 files on which the operation succeeded are untagged. Failed and skipped
1946 files are left tagged.
1947
1949 The copy/move operations let you translate the names of files in an
1950 easy way. To do it, you have to specify the correct source mask and
1951 usually in the trailing part of the destination specify some wildcards.
1952 All the files matching the source mask are copied/renamed according to
1953 the target mask. If there are tagged files, only the tagged files
1954 matching the source mask are renamed.
1955
1956 There are other options which you can set:
1957
1958 Follow links
1959
1960 determines whether make the symlinks and hardlinks in the source direc‐
1961 tory (recursively in subdirectories) new links in the target directory
1962 or whether would you like to copy their content.
1963
1964 Dive into subdirs
1965
1966 determines the behavior when the source directory is about to be
1967 copied, but the target directory already exists. The default action is
1968 to copy the contents of the source directory into the target directory.
1969 Enabling this option causes copying the source directory itself into
1970 the target directory.
1971
1972 For example, you want to copy directory /foo containing file bar to
1973 /bla/foo, which is an already existing directory. Normally (when Dive
1974 into subdirs is not set), mc would copy file /foo/bar into the file
1975 /bla/foo/bar. By enabling this option the /bla/foo/foo directory will
1976 be created, and /foo/bar will be copied into /bla/foo/foo/bar.
1977
1978 Preserve attributes
1979
1980 determines whether to preserve the permissions, timestamps and (if you
1981 are root) the ownership of the original files. If this option is not
1982 set, the current value of the umask will be respected.
1983
1984 Use shell patterns
1985
1986 When this option is on you can use the '*' and '?' wildcards in the
1987 source mask. They work like they do in the shell. In the target mask
1988 only the '*' and '\<digit>' wildcards are allowed. The first '*' wild‐
1989 card in the target mask corresponds to the first wildcard group in the
1990 source mask, the second '*' corresponds to the second group and so on.
1991 The '\1' wildcard corresponds to the first wildcard group in the source
1992 mask, the '\2' wildcard corresponds to the second group and so on all
1993 the way up to '\9'. The '\0' wildcard is the whole filename of the
1994 source file.
1995
1996 Two examples:
1997
1998 If the source mask is "*.tar.gz", the destination is "/bla/*.tgz" and
1999 the file to be copied is "foo.tar.gz", the copy will be "foo.tgz" in
2000 "/bla".
2001
2002 Suppose you want to swap basename and extension so that "file.c" would
2003 become "c.file" and so on. The source mask for this is "*.*" and the
2004 destination is "\2.\1".
2005
2006 Use shell patterns off
2007
2008 When the shell patterns option is off the MC doesn't do automatic
2009 grouping anymore. You must use '\(...\)' expressions in the source mask
2010 to specify meaning for the wildcards in the target mask. This is more
2011 flexible but also requires more typing. Otherwise target masks are sim‐
2012 ilar to the situation when the shell patterns option is on.
2013
2014 Two examples:
2015
2016 If the source mask is "^\(.*\)\.tar\.gz$", the destination is
2017 "/bla/*.tgz" and the file to be copied is "foo.tar.gz", the copy will
2018 be "/bla/foo.tgz".
2019
2020 Let's suppose you want to swap basename and extension so that "file.c"
2021 will become "c.file" and so on. The source mask for this is
2022 "^\(.*\)\.\(.*\)$" and the destination is "\2.\1".
2023
2024 Case Conversions
2025
2026 You can also change the case of the filenames. If you use '\u' or '\l'
2027 in the target mask, the next character will be converted to uppercase
2028 or lowercase correspondingly.
2029
2030 If you use '\U' or '\L' in the target mask, the next characters will be
2031 converted to uppercase or lowercase correspondingly up to the next '\E'
2032 or next '\U', '\L' or the end of the file name.
2033
2034 The '\u' and '\l' are stronger than '\U' and '\L'.
2035
2036 For example, if the source mask is '*' ( Use shell patterns on) or
2037 '^\(.*\)$' ( Use shell patterns off) and the target mask is '\L\u*' the
2038 file names will be converted to have initial upper case and otherwise
2039 lower case.
2040
2041 You can also use '\' as a quote character. For example, '\\' is a back‐
2042 slash and '\*' is an asterisk.
2043
2044 Stable symlinks
2045
2046 commands Midnight Commander, that it should change symlinks in the tar‐
2047 get, so that they'll point to the same location as it did before. With
2048 absolute symbolic links this does nothing, but if you have a relative
2049 one, it will recompute its value, adding necessary ../ and other direc‐
2050 tory parts and making the value as short as possible (most modern
2051 filesystems keep short symlinks inside inodes and thus don't waste much
2052 disk space).
2053
2054
2056 The dialog of group of files and directories selection or uselection.
2057 The input line allow enter the regular expression of filenames that
2058 will be selected/unselected.
2059
2060 When Files only checkbox is on, only files will be selected. If Files
2061 only is off, as files as directories will be selected. When Shell Pat‐
2062 terns checkbox is on, the regular expression is much like the filename
2063 globbing in the shell (* standing for zero or more characters and ?
2064 standing for one character). If Shell Patterns is off, then the tagging
2065 of files is done with normal regular expressions (see ed (1)). When
2066 Case sensitive checkbox is on, the selection will be case sensitive
2067 characters. If Case sensitive is off, the case will be ignored.
2068
2070 The mcdiff is a visual diff tool. You can compare two files and edit
2071 them in-place (diffs are updated dynamically). You can browse and view
2072 a working copy from popular version control systems (GIT, Subversion,
2073 etc).
2074
2075 Following shortcuts are available in internal diff viewer of Midnight
2076 Commander.
2077
2078 F1 Invoke the built-in hypertext help viewer.
2079
2080 F2 Save modified files.
2081
2082 F4 Edit file of the left panel in the internal editor.
2083
2084 F14 Edit file of the right panel in the internal editor.
2085
2086 F5 Merge the current hunk. Only the current hunk will be merged.
2087
2088 F7 Start search.
2089
2090 F17 Continue search.
2091
2092 F10, Esc, q
2093 Exit from diff viewer.
2094
2095 Alt-s, s
2096 Toggle show of hunk status.
2097
2098 Alt-n, l
2099 Toggle show of line numbers.
2100
2101 f Maximize left panel.
2102
2103 = Make panels equal in width.
2104
2105 > Reduce the size of the right panel.
2106
2107 < Reduce the size of the left panel.
2108
2109 c Toggle show of trailing carriage return (CR) symbol as ^M.
2110
2111 2, 3, 4, 8
2112 Set tabulation size
2113
2114 C-u Swap contents of diff panels.
2115
2116 C-r Refresh the screen.
2117
2118 C-o Switch to the subshell and show the command screen.
2119
2120 Enter, Space, n
2121 Find next diff hunk.
2122
2123 Backspace, p
2124 Find previous diff hunk.
2125
2126 g Go to line.
2127
2128 Down Scroll one line forward.
2129
2130 Up Scroll one line backward.
2131
2132 PageUp Move one page up.
2133
2134 PageDown
2135 Mves one page down.
2136
2137 Home, A1
2138 Moves to the line beginning.
2139
2140 End Moves to the line end.
2141
2142 C-Home Move to the file beginning.
2143
2144 C-End, C1
2145 Move to the file end.
2146
2148 The internal file viewer provides two display modes: ASCII and hex. To
2149 toggle between modes, use the F4 key.
2150
2151 The viewer will try to use the best method provided by your system or
2152 the file type to display the information. Some character sequences,
2153 which appear most often in preformatted manual pages, are displayed
2154 bold and underlined, thus making a pretty display of your files.
2155
2156 When in hex mode, the search function accepts text in quotes and con‐
2157 stant numbers. Text in quotes is matched exactly after removing the
2158 quotes. Each number matches one byte. You can mix quoted text with
2159 constants like this:
2160
2161 "String" 34 0xBB 012 "more text"
2162
2163 Numbers are always interpreted in hex. In the example above, "34" is
2164 interpreted as 0x34. The prefix "0x" isn't really needed: we could type
2165 "BB" instead of "0xBB". And "012" is interpreted as 0x12, not as an oc‐
2166 tal number.
2167
2168 Here is a listing of the actions associated with each key that the Mid‐
2169 night Commander handles in the internal file viewer.
2170
2171 F1 Invoke the built-in hypertext help viewer.
2172
2173 F2 Toggle the wrap mode.
2174
2175 F4 Toggle the hex mode.
2176
2177 F5 Goto. You can specify a line number, offset or percentage of
2178 file size of position that you want to view.
2179
2180 F7, /, ?
2181 Start search. These keys call the dialog window that allows you
2182 to set up the search options. If key is ? the "Backwards" option
2183 is on.
2184
2185 C-s Continue forward search.
2186
2187 C-r Continue reverse search.
2188
2189 F17, n Continue search in the chosen direction.
2190
2191 N Temporary change the search direction: backwards if forward
2192 search is chosen, and vice versa.
2193
2194 F8 Toggle Raw/Parsed mode: This will show the file as found on disk
2195 or if a processing filter has been specified in the mc.ext.ini
2196 file, then the output from the filter. Current mode is always
2197 the other than written on the button label, since on the button
2198 is the mode which you enter by that key.
2199
2200 F9 Toggle the format/unformat mode: when format mode is on the
2201 viewer will interpret some string sequences to show bold and un‐
2202 derline with different colors. Also, on button label is the
2203 other mode than current.
2204
2205 F10, Esc.
2206 Exit the internal file viewer.
2207
2208 PageDown, space, C-v.
2209 Scroll one page forward.
2210
2211 PageUp, Alt-v, C-b, Backspace.
2212 Scroll one page backward.
2213
2214 Down Scroll one line forward.
2215
2216 Up Scroll one line backward.
2217
2218 C-l Refresh the screen.
2219
2220 C-o Switch to the subshell and show the command screen.
2221
2222 [n] m Set the mark n.
2223
2224 [n] r Jump to the mark n.
2225
2226 C-f Jump to the next file.
2227
2228 C-b Jump to the previous file.
2229
2230 Alt-r Toggle the ruler.
2231
2232 Alt-e to change charset of displayed text may use Alt-e (M-e). Recod‐
2233 ing is made from selected codepage into system codepage. To can‐
2234 cel the recoding you may select "<No translation>" in charset
2235 selection dialog.
2236
2237 It's possible to instruct the file viewer how to display a file, look
2238 at the Edit Extension File section
2239
2240
2242 The internal file editor is a full-featured full screen editor. It can
2243 edit files up to 64 megabytes. It is possible to edit binary files.
2244 The internal file editor is invoked using F4 if the use_internal_edit
2245 option is set in the initialization file.
2246
2247 The features it presently supports are: block copy, move, delete, cut,
2248 paste; key for key undo; pull-down menus; file insertion; macro com‐
2249 mands; regular expression search and replace; S-arrow text highlighting
2250 (if supported by the terminal); insert-overwrite toggle; word wrap; au‐
2251 toindent; tunable tab size; syntax highlighting for various file types;
2252 and an option to pipe text blocks through shell commands like indent
2253 and ispell.
2254
2255 Sections:
2256
2257 Options of editor in ini-file
2258
2259 The editor is very easy to use and requires no tutoring. To see what
2260 keys do what, just consult the appropriate pull-down menu. Other keys
2261 are: Shift movement keys do text highlighting. C-Ins copies to the
2262 file mcedit.clip and S-Ins pastes from mcedit.clip. S-Del cuts to
2263 mcedit.clip, and C-Del deletes highlighted text. Mouse highlighting
2264 also works, and you can override the mouse as usual by holding down the
2265 shift key while dragging the mouse to let normal terminal mouse high‐
2266 lighting work.
2267
2268 To define a macro, press C-R and then type out the key strokes you want
2269 to be executed. Press C-R again when finished. You can then assign the
2270 macro to any key you like by pressing that key. The macro is executed
2271 when you press C-A and then the assigned key. The macro is also exe‐
2272 cuted if you press Meta, Ctrl, or Esc and the assigned key, provided
2273 that the key is not used for any other function. Once defined, the
2274 macro commands go into the file ~/.local/share/mc/mcedit/mcedit.macros
2275 You can delete a macro by deleting the appropriate line in this file.
2276
2277 To change charset of displayed text may use Alt-e (M-e). Recoding is
2278 made from selected codepage into system codepage. To cancel the recod‐
2279 ing you may select "<No translation>" in charset selection dialog.
2280
2281 F19 will format the currently highlighted block (plain text or C or C++
2282 code or another). This is controlled by the file /usr/share/mc/edit.in‐
2283 dent.rc which is copied to ~/.local/share/mc/mcedit/edit.indent.rc in
2284 your home directory the first time you use it.
2285
2286 The editor also displays non-us characters (160+). When editing binary
2287 files, you should set display bits to 7 bits in the options menu to
2288 keep the spacing clean.
2289
2290
2292 Some editor options of ini-file are described in this section. Options
2293 are placed in [Midnight-Commander] section
2294
2295 editor_wordcompletion_collect_entire_file
2296 Search autocomplete candidates in entire of file or just from
2297 begin of file to cursor position (0)
2298
2299
2301 Midnight Commander supports running many internal modules (such as edi‐
2302 tor, viewer and diff viewer) simultaneously and switching between them
2303 without closing open files. Using several file managers at a time, how‐
2304 ever, is not currently supported.
2305
2306 Let's call each of these modules a screen. There are three ways to
2307 switch between screens, using one of these global shortcuts:
2308
2309 Alt-} switch to the next screen;
2310
2311 Alt-{ switch to the previous screen;
2312
2313 Alt-` open a dialog window with the list of currently open screens (or
2314 use the "Screen list" menu item).
2315
2317 Let Midnight Commander type for you.
2318
2319 Attempt to perform completion on the text before current position. MC
2320 attempts completion treating the text as variable (if the text begins
2321 with $), username (if the text begins with ~), hostname (if the text
2322 begins with @) or command (if you are on the command line in the posi‐
2323 tion where you might type a command, possible completions then include
2324 shell reserved words and shell built-in commands as well) in turn. If
2325 none of these matches, filename completion is attempted.
2326
2327 Filename, username, variable and hostname completion works on all input
2328 lines, command completion is command line specific. If the completion
2329 is ambiguous (there are more different possibilities), MC beeps and the
2330 following action depends on the setting of the Complete: show all op‐
2331 tion in the Configuration dialog. If it is enabled, a list of all pos‐
2332 sibilities pops up next to the current position and you can select with
2333 the arrow keys and Enter the correct entry. You can also type the
2334 first letters in which the possibilities differ to move to a subset of
2335 all possibilities and complete as much as possible. If you press
2336 Alt-Tab again, only the subset will be shown in the listbox, otherwise
2337 the first item which matches all the previous characters will be high‐
2338 lighted. As soon as there is no ambiguity, dialog disappears, but you
2339 can hide it by canceling keys Esc, F10 and left and right arrow keys.
2340 If Complete: show all is disabled, the dialog pops up only if you press
2341 Alt-Tab for the second time, for the first time MC just beeps.
2342
2343 Apply escaping of ?, *, and & symbols (as \?, \*, and \&) in filenames
2344 to disallow use them as metasymbols in regular expressions when substi‐
2345 tution is performed in the input line.
2346
2347
2349 Midnight Commander is provided with a code layer to access the file
2350 system; this code layer is known as the virtual file system switch.
2351 The virtual file system switch allows Midnight Commander to manipulate
2352 files not located on the Unix file system.
2353
2354 Currently, Midnight Commander is packaged with some Virtual File Sys‐
2355 tems (VFS): the local file system, used for accessing the regular Unix
2356 file system; the ftpfs, used to manipulate files on remote systems with
2357 the FTP protocol; the tarfs, used to manipulate tar and compressed tar
2358 files; the undelfs, used to recover deleted files on ext2 file systems
2359 (the default file system for Linux systems), fish (for manipulating
2360 files over shell connections such as rsh and ssh). If the code was
2361 compiled with sftpfs (for manipulating files over SFTP connections).
2362
2363 A generic extfs (EXTernal virtual File System) is provided in order to
2364 easily expand VFS capabilities using scripts and external software.
2365
2366 The VFS switch code will interpret all of the path names used and will
2367 forward them to the correct file system, the formats used for each one
2368 of the file systems is described later in their own section.
2369
2370 FTP File System
2371 The FTP File System (ftpfs) allows you to manipulate files on remote
2372 machines. To actually use it, you can use the FTP link item in the
2373 menu or directly change your current directory using the cd command to
2374 a path name that looks like this:
2375
2376 ftp://[!][user[:pass]@]machine[:port][remote-dir]
2377
2378 The user, port and remote-dir elements are optional. If you specify
2379 the user element, Midnight Commander will login to the remote machine
2380 as that user, otherwise it will use anonymous login or the login name
2381 from the ~/.netrc file. The optional pass element is the password used
2382 for the connection. Using the password in the VFS directory name is
2383 not recommended, because it can appear on the screen in clear text and
2384 can be saved to the directory history.
2385
2386 To enable using FTP proxy, prepend ! (an exclamation sign) to the
2387 hostname.
2388
2389 Examples:
2390
2391 ftp://ftp.nuclecu.unam.mx/linux/local
2392 ftp://tsx-11.mit.edu/pub/linux/packages
2393 ftp://!behind.firewall.edu/pub
2394 ftp://guest@remote-host.com:40/pub
2395 ftp://miguel:xxx@server/pub
2396
2397 Please check the Virtual File System dialog box for ftpfs options.
2398
2399 Tar File System
2400 The tar file system provides you with read-only access to your tar
2401 files and compressed tar files by using the chdir command. To change
2402 your directory to a tar file, you change your current directory to the
2403 tar file by using the following syntax:
2404
2405 /filename.tar/utar://[dir-inside-tar]
2406
2407 The mc.ext.ini file already provides a shortcut for tar files, this
2408 means that usually you just point to a tar file and press return to en‐
2409 ter into the tar file, see the Edit Extension File section for details
2410 on how this is done.
2411
2412 Examples:
2413
2414 mc-3.0.tar.gz/utar://mc-3.0/vfs
2415 /ftp/GCC/gcc-2.7.0.tar/utar://
2416
2417 The latter specifies the full path of the tar archive.
2418
2419 FIle transfer over SHell filesystem
2420 The fish file system is a network based file system that allows you to
2421 manipulate the files in a remote machine as if they were local. To use
2422 this, the other side has to either run fish server, or has to have
2423 bash-compatible shell.
2424
2425 To connect to a remote machine, you just need to chdir into a special
2426 directory which name is in the following format:
2427
2428 sh://[user@]machine[:options]/[remote-dir]
2429
2430 The user, options and remote-dir elements are optional. If you specify
2431 the user element, Midnight Commander will try to login on the remote
2432 machine as that user, otherwise it will use your login name.
2433
2434 The available options are:
2435 'C' - use compression;
2436 'r' - use rsh instead of ssh;
2437 port - specify the port used by remote server.
2438 If the remote-dir element is present, your current directory on the re‐
2439 mote machine will be set to this one.
2440
2441 Examples:
2442
2443 sh://onlyrsh.mx:r/linux/local
2444 sh://joe@want.compression.edu:C/private
2445 sh://joe@noncompressed.ssh.edu/private
2446 sh://joe@somehost.ssh.edu:2222/private
2447
2448 SFTP (SSH File Transfer Protocol) filesystem
2449 The SFTP file system is a network based file system that allows you to
2450 manipulate the files in a remote machine as if they were local.
2451
2452 To connect to a remote machine, you just need to chdir into a special
2453 directory which name is in the following format:
2454
2455 sftp://[user@]machine:[port]/[remote-dir]
2456
2457 The user, port and remote-dir elements are optional. If you specify
2458 the user element, Midnight Commander will try to login on the remote
2459 machine as that user, otherwise it will use your login name. port -
2460 specify the port used by remote server (22 by default). If the re‐
2461 mote-dir element is present, your current directory on the remote ma‐
2462 chine will be set to this one.
2463
2464 Examples:
2465
2466 sftp://onlyrsh.mx/linux/local
2467 sftp://joe:password@want.compression.edu/private
2468 sftp://joe@noncompressed.ssh.edu/private
2469 sftp://joe@somehost.ssh.edu:2222/private
2470
2471 When establishing the connection, server key fingerprint is verified
2472 using the ~/.ssh/known_hosts file. If the host/key pair is not found or
2473 the host is found, but the key doesn't match, an appropriate message is
2474 shown. There are three buttons in the message dialog:
2475
2476 [Yes] add new host/key pair to the ~/.ssh/known_hosts file and con‐
2477 tinue.
2478
2479 [Ignore] do not add new host/key pair to the ~/.ssh/known_hosts file,
2480 but continue nevertheless (at you own risk).
2481
2482 [No] abort connection.
2483
2484 Undelete File System
2485 On Linux systems, if you asked configure to use the ext2fs undelete fa‐
2486 cilities, you will have the undelete file system available. Recovery
2487 of deleted files is only available on ext2 file systems. The undelete
2488 file system is just an interface to the ext2fs library to retrieve all
2489 of the deleted files names on an ext2fs and provides and to extract the
2490 selected files into a regular partition.
2491
2492 To use this file system, you have to chdir into the special file name
2493 formed by the "undel://" prefix and the file name where the actual file
2494 system resides.
2495
2496 For example, to recover deleted files on the second partition of the
2497 first SCSI disk on Linux, you would use the following path name:
2498
2499 undel://sda2
2500
2501 It may take a while for the undelfs to load the required information
2502 before you start browsing files there.
2503
2504 EXTernal File System
2505 extfs allows you to integrate numerous features and file types into GNU
2506 Midnight Commander in an easy way, by writing scripts.
2507
2508 Extfs filesystems can be divided into two categories:
2509
2510 1. Stand-alone filesystems, which are not associated with any existing
2511 file. They represent certain system-wide data as a directory tree.
2512 You can invoke them by typing cd fsname:// where fsname is an extfs
2513 short name (see below). Examples of such filesystems include audio
2514 (list audio tracks on the CD) or apt (list of all Debian packages in
2515 the system).
2516
2517 For example, to list CD-Audio tracks on your CD-ROM drive, type
2518
2519 cd audio://
2520
2521 2. 'Archive' filesystems (like rpm, patchfs and more), which represent
2522 contents of a file as a directory tree. It can consist of 'real' files
2523 compressed in an archive (urar, rpm) or virtual files, like messages in
2524 a mailbox (mailfs) or parts of a patch (patchfs). To access such
2525 filesystems fsname:// should be appended to the archive name. Note
2526 that the archive itself can be on another vfs.
2527
2528 For example, to list contents of a zip archive documents.zip type
2529
2530 cd documents.zip/uzip://
2531
2532 In many aspects, you could treat extfs like any other directory. For
2533 instance, you can add it to the hotlist or change to it from directory
2534 history. An important limitation is that you cannot invoke shell com‐
2535 mands inside extfs, just like any other non-local VFS.
2536
2537 Common extfs scripts included with Midnight Commander are:
2538
2539 a access 'A:' DOS/Windows diskette (cd a://).
2540
2541 apt front end to Debian's APT package management system (cd apt://).
2542
2543 audio audio CD ripping and playing (cd audio:// or cd device/au‐
2544 dio://).
2545
2546 bpp package of Bad Penguin GNU/Linux distribution (cd
2547 file.bpp/bpp://).
2548
2549 deb package of Debian GNU/Linux distribution (cd file.deb/deb://).
2550
2551 dpkg Debian GNU/Linux installed packages (cd deb://).
2552
2553 hp48 view and copy files to/from a HP48 calculator (cd hp48://).
2554
2555 lslR browsing of lslR listings as found on many FTPs (cd file‐
2556 name/lslR://).
2557
2558 mailfs mbox-style mailbox files support (cd mailbox/mailfs://).
2559
2560 patchfs
2561 extfs to handle unified and context diffs (cd file‐
2562 name/patchfs://).
2563
2564 rpm RPM package (cd filename/rpm://).
2565
2566 rpms RPM database management (cd rpms://).
2567
2568 ulha, urar, uzip, uzoo, uar, uha
2569 archivers (cd archive/xxxx:// where xxxx is one of: ulha, urar,
2570 uzip, uzoo, uar, uha).
2571
2572 You could bind file type/extension to specified extfs as described in
2573 the Edit Extension File section. Here is an example entry for Debian
2574 packages:
2575
2576 regex/.deb$
2577 Open=%cd %p/deb://
2578
2580 Midnight Commander will try to detect if your terminal supports color
2581 using the terminal database and your terminal name. Sometimes it gets
2582 confused, so you may force color mode or disable color mode using the
2583 -c and -b flag respectively.
2584
2585 If the program is compiled with the S-Lang screen manager instead of
2586 ncurses, it will also check the variable COLORTERM, if it is set, it
2587 has the same effect as the -c flag.
2588
2589 You may specify terminals that always force color mode by adding the
2590 color_terminals variable to the Colors section of the initialization
2591 file. This will prevent Midnight Commander from trying to detect if
2592 your terminal supports color. Example:
2593
2594 [Colors]
2595 color_terminals=linux,xterm
2596 color_terminals=terminal-name1,terminal-name2...
2597
2598 The program can be compiled with both ncurses and S-Lang, ncurses does
2599 not provide a way to force color mode: ncurses uses just the informa‐
2600 tion in the terminal database.
2601
2602 Midnight Commander provides a way to change the default colors. Cur‐
2603 rently the colors are configured using the environment variable
2604 MC_COLOR_TABLE or the Colors section in the initialization file.
2605
2606 In the Colors section, the default color map is loaded from the
2607 base_color variable. You can specify an alternate color map for a ter‐
2608 minal by using the terminal name as the key in this section. Example:
2609
2610 [Colors]
2611 base_color=
2612 xterm=menu=magenta:marked=,magenta:markselect=,red
2613
2614 The format for the color definition is:
2615
2616 <keyword>=<fgcolor>,<bgcolor>,<attributes>:<keyword>=...
2617
2618 The colors are optional, and the keywords are: normal, selected, dis‐
2619 abled, marked, markselect, errors, input, inputmark, inputunchanged,
2620 commandlinemark, reverse, gauge, header, inputhistory, commandhistory.
2621 Button bar colors are: bbarhotkey, bbarbutton. Status bar color: sta‐
2622 tusbar. Menu colors are: menunormal, menusel, menuhot, menuhotsel, men‐
2623 uinactive. Dialog colors are: dnormal, dfocus, dhotnormal, dhotfocus,
2624 dtitle. Error dialog colors are: errdfocus, errdhotnormal, errdhotfo‐
2625 cus, errdtitle. Help colors are: helpnormal, helpitalic, helpbold,
2626 helplink, helpslink, helptitle. Viewer colors are: viewnormal, view‐
2627 bold, viewunderline, viewselected. Editor colors are: editnormal, edit‐
2628 bold, editmarked, editwhitespace, editlinestate. Popup menu colors are:
2629 pmenunormal, pmenusel, pmenutitle.
2630
2631 header determines the color of panel header, the line that contains
2632 column titles and sort mode indicator.
2633
2634 input determines the color of input lines used in query dialogs.
2635
2636 gauge determines the color of the filled part of the progress bar
2637 (gauge), which is used to show the user the progress of file opera‐
2638 tions, such as copying.
2639
2640 disabled determines the color of the widget that cannot be selected.
2641
2642 The dialog boxes use the following colors: dnormal is used for the nor‐
2643 mal text, dfocus is the color used for the currently selected compo‐
2644 nent, dhotnormal is the color used to differentiate the hotkey color in
2645 normal components, whereas the dhotfocus color is used for the high‐
2646 lighted color in the currently selected component.
2647
2648 Menus use the same scheme but uses the menunormal, menusel, menuhot,
2649 menuhotsel and menuinactive tags instead.
2650
2651 Help uses the following colors: helpnormal is used for normal text,
2652 helpitalic is used for text which is emphasized in italic in the manual
2653 page, helpbold is used for text which is emphasized in bold in the man‐
2654 ual page, helplink is used for not selected hyperlinks and helpslink is
2655 used for selected hyperlink.
2656
2657 Popup menu uses following colors: pmenunormal is used for non-selected
2658 menu items and as a main color of popup menu window, pmenusel is used
2659 for selected menu item, pmenutitle is used for popup menu title.
2660
2661 The possible colors are: black, gray, red, brightred, green, bright‐
2662 green, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan,
2663 brightcyan, lightgray and white. And there is a special keyword for
2664 transparent background. It is 'default'. The 'default' can only be used
2665 for background color. Another special keyword "base" means mc's main
2666 colors. When 256 colors are available, they can be specified either as
2667 color16 to color255, or as rgb000 to rgb555 and gray0 to gray23. Exam‐
2668 ple:
2669
2670 [Colors]
2671 base_color=normal=white,default:marked=magenta,default
2672
2673 Attributes can be any of bold, italic, underline, reverse and blink,
2674 appended by a plus sign if more than one are desired. The special word
2675 "none" means no attributes, without attempting to fall back to
2676 base_color. Example:
2677
2678 menuhotsel=yellow;black;bold+underline
2679
2680
2682 You can change the appearance of Midnight Commander. To do this, you
2683 must specify a file that contain descriptions of colors and lines to
2684 draw boxes. Redefining of the colors is entirely compatible with the
2685 assignment of colors, as described in Section Colors.
2686
2687 If your skin contains any true-color definitions, you should define the
2688 'truecolors' key set to TRUE value in [skin] section. If true-color is
2689 not used but 256-color is, you should define '256colors' instead.
2690
2691 A skin-file is searched on the following algorithm (to the first one
2692 found):
2693
2694 1) command line option -S <skin> or --skin=<skin>
2695 2) Environment variable MC_SKIN
2696 3) Parameter skin in section [Midnight-Commander] in config
2697 file.
2698 4) File /etc/mc/skins/default.ini
2699 5) File /usr/share/mc/skins/default.ini
2700
2701
2702 Command line option, environment variable and parameter in config file
2703 may contain the absolute path to the skin-file (with the extension .ini
2704 or without it). Search of skin-file will occur in (to the first one
2705 found):
2706
2707 1) ~/.local/share/mc/skins/
2708 2) /etc/mc/skins/
2709 3) /usr/share/mc/skins/
2710
2711
2712 For getting extended info, refer to:
2713
2714 Description of section and parameters
2715 Color pair definitions
2716 Color and attribute aliases
2717 Draw lines
2718 Compatibility
2719
2720
2721 Description of section and parameters
2722 Section [skin] contain metainfo for skin-file. Parameter description
2723 contain short text about skin.
2724
2725
2726 Section [filehighlight] contain descriptions of color pairs for file‐
2727 names highlighting. Name of parameters must be equal to names of sec‐
2728 tions into filehighlight.ini file. See Filenames Highlight for getting
2729 more info.
2730
2731
2732 Section [core] describes the elements that are used everywhere.
2733
2734 _default_
2735 Default color pair. Used in all other sections if they not con‐
2736 tain color definitions
2737
2738 selected
2739 cursor
2740
2741 marked selected data
2742
2743 markselect
2744 cursor on selected data
2745
2746 gauge color of the filled part of the progress bar
2747
2748 input color of input lines used in query dialogs
2749
2750 inputmark
2751 color of input selected text
2752
2753 inputunchanged
2754 color of input text before first modification or cursor movement
2755
2756 commandlinemark
2757 color of selected text in command line
2758
2759 reverse
2760 reverse color
2761
2762 Section [dialog] describes the elements that are placed on dialog win‐
2763 dows (except error dialogs).
2764
2765 _default_
2766 Default color for this section. Used [core]._default_ if not
2767 specified
2768
2769 dfocus Color of active element (in focus)
2770
2771 dhotnormal
2772 Color of hotkeys
2773
2774 dhotfocus
2775 Color of hotkeys in focused element
2776
2777
2778 Section [error] describes the elements that are placed on error dialog
2779 windows
2780
2781 _default_
2782 Default color for this section. Used [core]._default_ if not
2783 specified
2784
2785 errdhotnormal
2786 Color of hotkeys
2787
2788 errdhotfocus
2789 Color of hotkeys in focused element
2790
2791
2792 Section [menu] describes the elements that are placed in menu. This
2793 section describes system menu (called by F9) and user-defined menus
2794 (called by F2 in panels and by F11 in editor).
2795
2796 _default_
2797 Default color for this section. Used [core]._default_ if not
2798 specified
2799
2800 entry Color of menu items
2801
2802 menuhot
2803 Color of menu hotkeys
2804
2805 menusel
2806 Color of active menu item (in focus)
2807
2808 menuhotsel
2809 Color of menu hotkeys in focused menu item
2810
2811 menuinactive
2812 Color of inactive menu
2813
2814
2815 Section [help] describes the elements that are placed on help window.
2816
2817 _default_
2818 Default color for this section. Used [core]._default_ if not
2819 specified
2820
2821 helpitalic
2822 Color pair for element with italic attribute
2823
2824 helpbold
2825 Color pair for element with bold attribute
2826
2827 helplink
2828 Color of links
2829
2830 helpslink
2831 Color of active link (on focus)
2832
2833
2834 Section [editor] describes the colors of elements placed in editor.
2835
2836 _default_
2837 Default color for this section. Used [core]._default_ if not
2838 specified
2839
2840 editbold
2841 Color pair for element with bold attribute
2842
2843 editmarked
2844 Color of selected text
2845
2846 editwhitespace
2847 Color of tabs and trailing spaces highlighting
2848
2849 editlinestate
2850 Color for line state area
2851
2852
2853 Section [viewer] describes the colors of elements placed in viewer.
2854
2855 viewunderline
2856 Color pair for element with underline attribute
2857
2858
2859 Color pair definitions
2860 Any parameter in skin-file contain definition of color pair.
2861
2862 Color pairs described as two colors and the optional attributes sepa‐
2863 rated by ';'. First field sets the foreground color, second field sets
2864 background color, third field sets the attributes. Any of the fields
2865 may be omitted, in this case value will be taken from default color
2866 pair (global color pair or from default color pair of this section).
2867
2868 Example:
2869 [core]
2870 # green on black
2871 _default_=green;black
2872 # green (default) on blue
2873 selected=;blue
2874 # yellow on black (default)
2875 # underlined yellow on black (default)
2876 marked=yellow;;underline
2877
2878
2879 Possible colors (names) and attributes are described in Colors. sec‐
2880 tion.
2881
2882
2883 Color and attribute aliases
2884 This optional section might define aliases for single colors (not color
2885 pairs) as well as combination of attributes; in other words, for semi‐
2886 colon-separated fragments of parameters. Aliases can refer to other
2887 aliases as long as they don't form a loop.
2888
2889 Example:
2890 [aliases]
2891 myfavfg=green
2892 myfavbg=black
2893 myfavattr=bold+italic
2894 [core]
2895 _default_=myfavfg;myfavbg;myfavattr
2896
2897
2898 Draw lines
2899 Lines sets in section [Lines] into skin-file. By default single lines
2900 are used, but you may redefine to usage of any utf-8 symbols (like to
2901 lines, for example).
2902
2903 WARNING!!! When you build Midnight Commander with the ncurses screen
2904 library usage of drawing lines is limited! Possible only drawing a
2905 single lines. For all questions and comments please contact the devel‐
2906 opers of ncurses.
2907
2908
2909 Descriptions of parameters [Lines]:
2910
2911 lefttop
2912 left-top line fragment.
2913
2914 righttop
2915 right-top line fragment.
2916
2917 centertop
2918 down branch of horizontal line
2919
2920 centerbottom
2921 up branch of horizontal line
2922
2923 leftbottom
2924 left-bottom line fragment
2925
2926 rightbottom
2927 right-bottom line fragment
2928
2929 leftmiddle
2930 right branch of vertical line
2931
2932 rightmiddle
2933 left branch of vertical line
2934
2935 centermiddle
2936 cross of lines
2937
2938 horiz horizontal line
2939
2940 vert vertical line
2941
2942 thinhoriz
2943 thin horizontal line
2944
2945 thinvert
2946 thin vertical line
2947
2948
2949
2950 Compatibility
2951 Appointment of color by skin-files fully compatible with the appoint‐
2952 ment of the colors described in Colors. section.
2953
2954 In this case, reassignment of colors has priority over the skin file
2955 and is complementary.
2956
2957
2959 Section [filehighlight] in current skin-file contains key names as
2960 highlight groups and values as color pairs. Color pairs is documented
2961 in Skins section.
2962
2963 Rules of filenames highlight are placed in /usr/share/mc/filehigh‐
2964 light.ini file (~/.config/mc/filehighlight.ini). Name of section in
2965 this file must be equal to parameters names in [filehighlight] section
2966 (in current skin-file).
2967
2968 Keys in these groups are:
2969
2970 type file type. If present, all other options are ignored.
2971
2972 regexp regular expression. If present, 'extensions' option is ignored.
2973
2974 extensions
2975 list of extensions of files. Separated by ';' sign.
2976
2977 extensions_case
2978 (make sense only with 'extensions' parameter) make 'extensions'
2979 rule case sensitive (true) or not (false).
2980
2981 `type' key may have values:
2982 - FILE (all files)
2983 - FILE_EXE
2984 - DIR (all directories)
2985 - LINK_DIR
2986 - LINK (all links except stale link)
2987 - HARDLINK
2988 - SYMLINK
2989 - STALE_LINK
2990 - DEVICE (all device files)
2991 - DEVICE_BLOCK
2992 - DEVICE_CHAR
2993 - SPECIAL (all special files)
2994 - SPECIAL_SOCKET
2995 - SPECIAL_FIFO
2996 - SPECIAL_DOOR
2997
2999 Most of Midnight Commander settings can be changed from the menus. How‐
3000 ever, there are a small number of settings which can only be changed by
3001 editing the setup file.
3002
3003 These variables may be set in your ~/.config/mc/ini file:
3004
3005 clear_before_exec
3006 By default, Midnight Commander clears the screen before execut‐
3007 ing a command. If you would prefer to see the output of the
3008 command at the bottom of the screen, edit your ~/.config/mc/ini
3009 file and change the value of the field clear_before_exec to 0.
3010
3011 confirm_view_dir
3012 If you press F3 on a directory, normally MC enters that direc‐
3013 tory. If this flag is set to 1, then MC will ask for confirma‐
3014 tion before changing the directory if you have files tagged.
3015
3016 ftpfs_retry_seconds
3017 This value is the number of seconds Midnight Commander will wait
3018 before attempting to reconnect to an FTP server that has denied
3019 the login. If the value is zero, the login will no be retried.
3020
3021 max_dirt_limit
3022 Specifies how many screen updates can be skipped at most in the
3023 internal file viewer. Normally this value is not significant,
3024 because the code automatically adjusts the number of updates to
3025 skip according to the rate of incoming keystrokes. However, on
3026 very slow machines or terminals with a fast keyboard auto re‐
3027 peat, a big value can make screen updates too jumpy.
3028
3029 It seems that setting max_dirt_limit to 10 causes the best be‐
3030 havior, and that is the default value.
3031
3032 mouse_move_pages_viewer
3033 Controls if scrolling with the mouse is done by pages or line by
3034 line on the internal file viewer.
3035
3036 only_leading_plus_minus
3037 Allow special treatment for '+', '-', '*' in the command line
3038 (select, unselect, reverse selection) only if the command line
3039 is empty. You don't need to quote those characters in the mid‐
3040 dle of the command line. On the other hand, you cannot use them
3041 to change selection when the command line is not empty.
3042
3043 alternate_plus_minus
3044 If true, use '+', '-', '\' and '*' keys normally. For select/un‐
3045 select, use 'Alt-+', 'Alt--' and 'Alt-*'.
3046
3047 show_output_starts_shell
3048 This variable only works if you are not using the subshell sup‐
3049 port. When you use the C-o keystroke to go back to the user
3050 screen, if this one is set, you will get a fresh shell. Other‐
3051 wise, pressing any key will bring you back to Midnight Comman‐
3052 der.
3053
3054 timeformat_recent
3055 Change the time format used to display dates less than 6 months
3056 from now. See strftime or date man page for the format specifi‐
3057 cation. If this option is absent, default timeformat is used.
3058
3059 timeformat_old
3060 Change the time format used to display dates older than 6
3061 months from now or for dates in the future. See strftime or
3062 date man page for the format specification. If this option is
3063 absent, default timeformat is used.
3064
3065 torben_fj_mode
3066 If this flag is set, then the home and end keys will work
3067 slightly different on the panels, instead of moving the selec‐
3068 tion to the first and last files in the panels, they will act as
3069 follows:
3070
3071 The home key will: Go up to the middle line, if below it; else
3072 go to the top line unless it is already on the top line, in this
3073 case it will go to the first file in the panel.
3074
3075 The end key has a similar behavior: Go down to the middle line,
3076 if over it; else go to the bottom line unless you already are at
3077 the bottom line, in such case it will move the selection to the
3078 last file name in the panel.
3079
3080 use_file_to_guess_type
3081 If this variable is on (the default) it will spawn the file com‐
3082 mand to match the file types listed on the mc.ext.ini file.
3083
3084 xtree_mode
3085 If this variable is on (default is off) when you browse the file
3086 system on a Tree panel, it will automatically reload the other
3087 panel with the contents of the selected directory.
3088
3089 fish_directory_timeout
3090 This variable holds the lifetime of a directory cache entry in
3091 seconds. The default value is 900 seconds.
3092
3093 clipboard_store
3094 This variable contains path (with options) to the external clip‐
3095 board utility like 'xclip' to read text into X selection from
3096 file. For example:
3097
3098 clipboard_store=xclip -i
3099
3100 clipboard_paste
3101 This variable contains path (with options) to the external clip‐
3102 board utility like 'xclip' to print the selection to standard
3103 out. For example:
3104
3105 clipboard_paste=xclip -o
3106
3107 autodetect_codeset
3108 This option allows use the `enca' command to autodetect codeset
3109 of text files in internal viewer and editor. List of valid val‐
3110 ues can be obtain by the `enca --list languages | cut -d : -f1'
3111 command. Option must be located in the [Misc] section.
3112
3113 For example:
3114
3115 autodetect_codeset=russian
3116
3118 Midnight Commander provides a way for specify an options for external
3119 editors and viewers. Midnight Commander tries to search the "[External
3120 editor or viewer parameters]" section in the system initialization file
3121 (the mc.lib file located in Midnight Commander's library directory) and
3122 then in the ~/.config/mc/ini file. The option name should be equal to
3123 the name (full pathname) of external editor or viewer. The option value
3124 can contain following variables:
3125
3126 %filename
3127 The filename to edit/view.
3128
3129 %lineno
3130 The start line in the opening file.
3131
3132 For example:
3133
3134 [External editor or viewer parameters]
3135 vi=%filename +%lineno
3136 joe=%filename +%lineno
3137 more=%filename +%lineno
3138
3139 Start line is passed to the external editor/viewer only if it is called
3140 from the Find file results window.
3141
3142 If external editor/viewer is launched via F4/F3 keys, MC hopes that
3143 program (at least "joe", but probably others too) has an own feature
3144 that by default opens the file where it was last open. MC doesn't pre‐
3145 vent external editor/viewer to save and restore position in opened
3146 files.
3147
3149 Midnight Commander provides a way to fix your system terminal database
3150 without requiring root privileges. Midnight Commander searches in the
3151 system initialization file (the mc.lib file located in Midnight Comman‐
3152 der's library directory) and in the ~/.config/mc/ini file for the sec‐
3153 tion "terminal:your-terminal-name" and then for the section "termi‐
3154 nal:general", each line of the section contains a key symbol that you
3155 want to define, followed by an equal sign and the definition for the
3156 key. You can use the special \e form to represent the escape character
3157 and the ^x to represent the control-x character.
3158
3159 The possible key symbols are:
3160
3161 f0 to f20 Function keys f0-f20
3162 bs backspace
3163 home home key
3164 end end key
3165 up up arrow key
3166 down down arrow key
3167 left left arrow key
3168 right right arrow key
3169 pgdn page down key
3170 pgup page up key
3171 insert the insert character
3172 delete the delete character
3173 complete to do completion
3174
3175 For example, to define the key insert to be the Escape + [ + O + p, you
3176 set this in the ini file:
3177
3178 insert=\e[Op
3179
3180
3181 Also now you can use extended learn keys. For example:
3182
3183 ctrl-alt-right=\e[[1;6C
3184 ctrl-alt-left=\e[[1;6D
3185
3186
3187 This means that ctrl+alt+left sends a \e[[1;6D escape sequence and
3188 therefore Midnight Commander interprets "\e[[1;6D" as C-Alt-Left.
3189
3190
3191 The complete key symbol represents the escape sequences used to invoke
3192 the completion process, this is invoked with Alt-tab, but you can de‐
3193 fine other keys to do the same work (on those keyboard with tons of
3194 nice and unused keys everywhere).
3195
3196
3198 Full paths below may vary between installations. They are also af‐
3199 fected by the MC_DATADIR environment variable. If it's set, its value
3200 is used instead of /usr/share/mc in the paths below.
3201
3202 /usr/share/mc/help/mc.hlp
3203
3204 The help file for the program.
3205
3206 /usr/share/mc/mc.ext.ini
3207
3208 The default system-wide extensions file.
3209
3210 ~/.config/mc/mc.ext.ini
3211
3212 User's own extension, view configuration and edit configuration
3213 file. They override the contents of the system wide files if
3214 present.
3215
3216 /etc/mc/mc.ini
3217 /usr/share/mc/mc.ini
3218
3219 System-wide setup files for Midnight Commander, used only if the
3220 user doesn't have his own ~/.config/mc/ini file. If
3221 /etc/mc/mc.ini exists, /usr/share/mc/mc.ini isn't used.
3222
3223 /usr/share/mc/mc.lib
3224
3225 Global settings for Midnight Commander. Settings in this file
3226 affect all users, whether they have ~/.config/mc/ini or not.
3227 Currently, only terminal settings are loaded from mc.lib.
3228
3229 ~/.config/mc/ini
3230
3231 User's own setup. If this file is present then the setup is
3232 loaded from here instead of the system-wide startup file.
3233
3234 /usr/share/mc/hints/mc.hint
3235
3236 This file contains the hints displayed by the program.
3237
3238 /usr/share/mc/mc.menu
3239
3240 This file contains the default system-wide applications menu.
3241
3242 ~/.config/mc/menu
3243
3244 User's own application menu. If this file is present it is used
3245 instead of the system-wide applications menu.
3246
3247 ~/.cache/mc/Tree
3248
3249 The directory list for the directory tree and tree view fea‐
3250 tures.
3251
3252 ~/.local/share/mc.menu
3253
3254 Local user-defined menu. If this file is present, it is used in‐
3255 stead of the home or system-wide applications menu.
3256
3257 To change default root directory of MC, you can use MC_PROFILE_ROOT en‐
3258 vironment variable. The value of MC_PROFILE_ROOT must be an absolute
3259 path. If MC_PROFILE_ROOT is unset or empty, HOME variable is used. If
3260 HOME is unset or empty, MC directories are get from GLib library.
3261
3263 This program is distributed under the terms of the GNU General Public
3264 License as published by the Free Software Foundation. See the built-in
3265 help for details on the License and the lack of warranty.
3266
3268 The latest version of this program can be found at http://ftp.mid‐
3269 night-commander.org/.
3270
3272 ed(1), gpm(1), terminfo(1), view(1), sh(1), bash(1), tcsh(1), zsh(1).
3273
3274 Midnight Commander's page on the World Wide Web:
3275 https://www.midnight-commander.org/
3276
3278 Authors and contributors are listed in the AUTHORS file in the source
3279 distribution.
3280
3282 See the file TODO in the distribution for information on what remains
3283 to be done.
3284
3285 If you want to report a problem with the program, please create bugre‐
3286 port at https://www.midnight-commander.org/.
3287
3288 Provide a detailed description of the bug, the version of the program
3289 you are running (mc -V displays this information), the operating system
3290 you are running the program on. If the program crashes, we would ap‐
3291 preciate a stack trace.
3292
3293
3294
3295MC Version 4.8.30 August 2023 MC(1)