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 Unix-
13 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
24 information.
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 -d, --nomouse
31 Disable mouse support.
32
33 -e [file], --edit[=file]
34 Start the internal editor. If the file is specified, open it on
35 startup. See also mcedit (1).
36
37 -f, --datadir
38 Display the compiled-in search paths for Midnight Commander
39 files.
40
41 -k, --resetsoft
42 Reset softkeys to their default from the termcap/terminfo data‐
43 base. Only useful on HP terminals when the function keys don't
44 work.
45
46 -l file, --ftplog=file
47 Save the ftpfs dialog with the server in file.
48
49 -P file, --printwd=file
50 Print the last working directory to the specified file. This
51 option is not meant to be used directly. Instead, it's used
52 from a special shell script that automatically changes the cur‐
53 rent directory of the shell to the last directory the Midnight
54 Commander was in. Source the file /usr/share/mc/bin/mc.sh (bash
55 and zsh users) or /usr/share/mc/bin/mc.csh (tcsh users) respec‐
56 tively to define mc as an alias to the appropriate shell script.
57
58 -s, --slow
59 Turn on the slow terminal mode, in this mode the program will
60 not draw expensive line drawing characters and will toggle ver‐
61 bose mode off.
62
63 -t, --termcap
64 Used only if the code was compiled with Slang and terminfo: it
65 makes the Midnight Commander use the value of the TERMCAP vari‐
66 able for the terminal information instead of the information on
67 the system wide terminal database
68
69 -u, --nosubshell
70 Disable use of the concurrent shell (only makes sense if the
71 Midnight Commander has been built with concurrent shell sup‐
72 port).
73
74 -U, --subshell
75 Enable use of the concurrent shell support (only makes sense if
76 the Midnight Commander was built with the subshell support set
77 as an optional feature).
78
79 -v file, --view=file
80 Start the internal viewer to view the specified file. See also
81 mcview (1).
82
83 -V, --version
84 Display the version of the program.
85
86 -x, --xterm
87 Force xterm mode. Used when running on xterm-capable terminals
88 (two screen modes, and able to send mouse escape sequences).
89
90 If specified, the first path name is the directory to show in the
91 selected panel; the second path name is the directory to be shown in
92 the other panel.
93
95 The screen of the Midnight Commander is divided into four parts.
96 Almost all of the screen space is taken up by two directory panels. By
97 default, the second line from the bottom of the screen is the shell
98 command line, and the bottom line shows the function key labels. The
99 topmost line is the menu bar line. The menu bar line may not be visi‐
100 ble, but appears if you click the topmost line with the mouse or press
101 the F9 key.
102
103 The Midnight Commander provides a view of two directories at the same
104 time. One of the panels is the current panel (a selection bar is in the
105 current panel). Almost all operations take place on the current panel.
106 Some file operations like Rename and Copy by default use the directory
107 of the unselected panel as a destination (don't worry, they always ask
108 you for confirmation first). For more information, see the sections on
109 the Directory Panels, the Left and Right Menus and the File Menu.
110
111 You can execute system commands from the Midnight Commander by simply
112 typing them. Everything you type will appear on the shell command line,
113 and when you press Enter the Midnight Commander will execute the com‐
114 mand line you typed; read the Shell Command Line and Input Line Keys
115 sections to learn more about the command line.
116
118 The Midnight Commander comes with mouse support. It is activated when‐
119 ever you are running on an xterm(1) terminal (it even works if you take
120 a telnet, ssh or rlogin connection to another machine from the xterm)
121 or if you are running on a Linux console and have the gpm mouse server
122 running.
123
124 When you left click on a file in the directory panels, that file is
125 selected; if you click with the right button, the file is marked (or
126 unmarked, depending on the previous state).
127
128 Double-clicking on a file will try to execute the command if it is an
129 executable program; and if the extension file has a program specified
130 for the file's extension, the specified program is executed.
131
132 Also, it is possible to execute the commands assigned to the function
133 key labels by clicking on them.
134
135 If a mouse button is clicked on the top frame line of the directory
136 panel, it is scrolled one page up. Likewise, a click on the bottom
137 frame line will cause scrolling one page down. This frame line method
138 works also in the Help Viewer and the Directory Tree.
139
140 The default auto repeat rate for the mouse buttons is 400 milliseconds.
141 This may be changed to other values by editing the ~/.mc/ini file and
142 changing the mouse_repeat_rate parameter.
143
144 If you are running the Midnight Commander with the mouse support, you
145 can get the default mouse behavior (cutting and pasting text) by hold‐
146 ing down the Shift key.
147
148
150 Some commands in the Midnight Commander involve the use of the Control
151 (sometimes labeled CTRL or CTL) and the Meta (sometimes labeled ALT or
152 even Compose) keys. In this manual we will use the following abbrevia‐
153 tions:
154
155 C-<chr>
156 means hold the Control key while typing the character <chr>.
157 Thus C-f would be: hold the Control key and type f.
158
159 Alt-<chr>
160 means hold the Meta or Alt key down while typing <chr>. If
161 there is no Meta or Alt key, type ESC, release it, then type the
162 character <chr>.
163
164 S-<chr>
165 means hold the Shift key down while typing <chr>.
166
167 All input lines in the Midnight Commander use an approximation to the
168 GNU Emacs editor's key bindings.
169
170 There are many sections which tell about the keys. The following are
171 the most important.
172
173 The File Menu section documents the keyboard shortcuts for the commands
174 appearing in the File menu. This section includes the function keys.
175 Most of these commands perform some action, usually on the selected
176 file or the tagged files.
177
178 The Directory Panels section documents the keys which select a file or
179 tag files as a target for a later action (the action is usually one
180 from the file menu).
181
182 The Shell Command Line section list the keys which are used for enter‐
183 ing and editing command lines. Most of these copy file names and such
184 from the directory panels to the command line (to avoid excessive typ‐
185 ing) or access the command line history.
186
187 Input Line Keys are used for editing input lines. This means both the
188 command line and the input lines in the query dialogs.
189
190 Miscellaneous Keys
191 Here are some keys which don't fall into any of the other categories:
192
193 Enter if there is some text in the command line (the one at the bottom
194 of the panels), then that command is executed. If there is no
195 text in the command line then if the selection bar is over a
196 directory the Midnight Commander does a chdir(2) to the selected
197 directory and reloads the information on the panel; if the
198 selection is an executable file then it is executed. Finally, if
199 the extension of the selected file name matches one of the
200 extensions in the extensions file then the corresponding command
201 is executed.
202
203 C-l repaint all the information in the Midnight Commander.
204
205 C-x c run the Chmod command on a file or on the tagged files.
206
207 C-x o run the Chown command on the current file or on the tagged
208 files.
209
210 C-x l run the link command.
211
212 C-x s run the symbolic link command.
213
214 C-x i set the other panel display mode to information.
215
216 C-x q set the other panel display mode to quick view.
217
218 C-x ! execute the External panelize command.
219
220 C-x h run the add directory to hotlist command.
221
222 Alt-! executes the Filtered view command, described in the view com‐
223 mand.
224
225 Alt-? executes the Find file command.
226
227 Alt-c pops up the quick cd dialog.
228
229 C-o when the program is being run in the Linux or FreeBSD console or
230 under an xterm, it will show you the output of the previous com‐
231 mand. When ran on the Linux console, the Midnight Commander
232 uses an external program (cons.saver) to handle saving and
233 restoring of information on the screen.
234
235 When the subshell support is compiled in, you can type C-o at any time
236 and you will be taken back to the Midnight Commander main screen, to
237 return to your application just type C-o. If you have an application
238 suspended by using this trick, you won't be able to execute other pro‐
239 grams from the Midnight Commander until you terminate the suspended
240 application.
241
242 Directory Panels
243 This section lists the keys which operate on the directory panels. If
244 you want to know how to change the appearance of the panels take a look
245 at the section on Left and Right Menus.
246
247 Tab, C-i
248 change the current panel. The old other panel becomes the new
249 current panel and the old current panel becomes the new other
250 panel. The selection bar moves from the old current panel to the
251 new current panel.
252
253 Insert, C-t
254 to tag files you may use the Insert key (the kich1 terminfo
255 sequence) or the C-t (Control-t) sequence. To untag files, just
256 retag a tagged file.
257
258 Alt-g, Alt-r, Alt-j
259 used to select the top file in a panel, the middle file and the
260 bottom one, respectively.
261
262 C-s, Alt-s
263 start a filename search in the directory listing. When the
264 search is active, the user input will be added to the search
265 string instead of the command line. If the Show mini-status
266 option is enabled the search string is shown on the mini-status
267 line. When typing, the selection bar will move to the next file
268 starting with the typed letters. The backspace or DEL keys can
269 be used to correct typing mistakes. If C-s is pressed again, the
270 next match is searched for.
271
272 Alt-t toggle the current display listing to show the next display
273 listing mode. With this it is possible to quickly switch to
274 brief listing, long listing, user defined listing mode, and back
275 to the default.
276
277 C-\ (control-backslash)
278 show the directory hotlist and change to the selected directory.
279
280 + (plus)
281 this is used to select (tag) a group of files. The Midnight Com‐
282 mander will prompt for a regular expression describing the
283 group. When Shell Patterns are enabled, the regular expression
284 is much like the regular expressions in the shell (* standing
285 for zero or more characters and ? standing for one character).
286 If Shell Patterns is off, then the tagging of files is done with
287 normal regular expressions (see ed (1)).
288
289 If the expression starts or ends with a slash (/), then it will select
290 directories instead of files.
291
292 \ (backslash)
293 use the "\" key to unselect a group of files. This is the oppo‐
294 site of the Plus key.
295
296 up-key, C-p
297 move the selection bar to the previous entry in the panel.
298
299 down-key, C-n
300 move the selection bar to the next entry in the panel.
301
302 home, a1, Alt-<
303 move the selection bar to the first entry in the panel.
304
305 end, c1, Alt->
306 move the selection bar to the last entry in the panel.
307
308 next-page, C-v
309 move the selection bar one page down.
310
311 prev-page, Alt-v
312 move the selection bar one page up.
313
314 Alt-o If the currently selected file is a directory, load that direc‐
315 tory on the other panel and moves the selection to the next
316 file.
317
318 Alt-i make the current directory of the current panel also the current
319 directory of the other panel. Put the other panel to the list‐
320 ing mode if needed. If the current panel is panelized, the
321 other panel doesn't become panelized.
322
323 C-PageUp, C-PageDown
324 only when supported by the terminal: change to ".." and to the
325 currently selected directory respectively.
326
327 Alt-y moves to the previous directory in the history, equivalent to
328 clicking the < with the mouse.
329
330 Alt-u moves to the next directory in the history, equivalent to click‐
331 ing the > with the mouse.
332
333 Alt-Shift-h, Alt-H
334 displays the directory history, equivalent to depressing the 'v'
335 with the mouse.
336
337 Shell Command Line
338 This section lists keys which are useful to avoid excessive typing when
339 entering shell commands.
340
341 Alt-Enter
342 copy the currently selected file name to the command line.
343
344 C-Enter
345 same a Alt-Enter. May not work on remote systems and some ter‐
346 minals.
347
348 C-Shift-Enter
349 copy the full path name of the currently selected file to the
350 command line. May not work on remote systems and some termi‐
351 nals.
352
353 Alt-Tab
354 does the filename, command, variable, username and hostname com‐
355 pletion for you.
356
357 C-x t, C-x C-t
358 copy the tagged files (or if there are no tagged files, the
359 selected file) of the current panel (C-x t) or of the other
360 panel (C-x C-t) to the command line.
361
362 C-x p, C-x C-p
363 the first key sequence copies the current path name to the com‐
364 mand line, and the second one copies the unselected panel's path
365 name to the command line.
366
367 C-q the quote command can be used to insert characters that are oth‐
368 erwise interpreted by the Midnight Commander (like the '+' sym‐
369 bol)
370
371 Alt-p, Alt-n
372 use these keys to browse through the command history. Alt-p
373 takes you to the last entry, Alt-n takes you to the next one.
374
375 Alt-h displays the history for the current input line.
376
377 General Movement Keys
378 The help viewer, the file viewer and the directory tree use common code
379 to handle moving. Therefore they accept exactly the same keys. Each of
380 them also accepts some keys of its own.
381
382 Other parts of the Midnight Commander use some of the same movement
383 keys, so this section may be of use for those parts too.
384
385 Up, C-p
386 moves one line backward.
387
388 Down, C-n
389 moves one line forward.
390
391 Prev Page, Page Up, Alt-v
392 moves one page up.
393
394 Next Page, Page Down, C-v
395 moves one page down.
396
397 Home, A1
398 moves to the beginning.
399
400 End, C1
401 move to the end.
402
403 The help viewer and the file viewer accept the following keys in addi‐
404 tion the to ones mentioned above:
405
406 b, C-b, C-h, Backspace, Delete
407 moves one page up.
408
409 Space bar
410 moves one page down.
411
412 u, d moves one half of a page up or down.
413
414 g, G moves to the beginning or to the end.
415
416 Input Line Keys
417 The input lines (they are used for the command line and for the query
418 dialogs in the program) accept these keys:
419
420 C-a puts the cursor at the beginning of line.
421
422 C-e puts the cursor at the end of the line.
423
424 C-b, move-left
425 move the cursor one position left.
426
427 C-f, move-right
428 move the cursor one position right.
429
430 Alt-f moves one word forward.
431
432 Alt-b moves one word backward.
433
434 C-h, backspace
435 delete the previous character.
436
437 C-d, Delete
438 delete the character in the point (over the cursor).
439
440 C-@ sets the mark for cutting.
441
442 C-w copies the text between the cursor and the mark to a kill buffer
443 and removes the text from the input line.
444
445 Alt-w copies the text between the cursor and the mark to a kill buf‐
446 fer.
447
448 C-y yanks back the contents of the kill buffer.
449
450 C-k kills the text from the cursor to the end of the line.
451
452 Alt-p, Alt-n
453 Use these keys to browse through the command history. Alt-p
454 takes you to the last entry, Alt-n takes you to the next one.
455
456 Alt-C-h, Alt-Backspace
457 delete one word backward.
458
459 Alt-Tab
460 does the filename, command, variable, username and hostname com‐
461 pletion for you.
462
463
465 The menu bar pops up when you press F9 or click the mouse on the top
466 row of the screen. The menu bar has five menus: "Left", "File", "Com‐
467 mand", "Options" and "Right".
468
469 The Left and Right Menus allow you to modify the appearance of the left
470 and right directory panels.
471
472 The File Menu lists the actions you can perform on the currently
473 selected file or the tagged files.
474
475 The Command Menu lists the actions which are more general and bear no
476 relation to the currently selected file or the tagged files.
477
478 The Options Menu lists the actions which allow you to customize the
479 Midnight Commander.
480
481 Left and Right (Above and Below) Menus
482 The outlook of the directory panels can be changed from the Left and
483 Right menus (they are named Above and Below when the horizontal panel
484 split is chosen from the Layout options dialog).
485
486 Listing Mode...
487 The listing mode view is used to display a listing of files, there are
488 four different listing modes available: Full, Brief, Long and User.
489 The full directory view shows the file name, the size of the file and
490 the modification time.
491
492 The brief view shows only the file name and it has two columns (there‐
493 fore showing twice as many files as other views). The long view is sim‐
494 ilar to the output of ls -l command. The long view takes the whole
495 screen width.
496
497 If you choose the "User" display format, then you have to specify the
498 display format.
499
500 The user display format must start with a panel size specifier. This
501 may be "half" or "full", and they specify a half screen panel and a
502 full screen panel respectively.
503
504 After the panel size, you may specify the two columns mode on the
505 panel, this is done by adding the number "2" to the user format string.
506
507 After this you add the name of the fields with an optional size speci‐
508 fier. This are the available fields you may display:
509
510 name displays the file name.
511
512 size displays the file size.
513
514 bsize is an alternative form of the size format. It displays the size
515 of the files and for directories it just shows SUB-DIR or
516 UP--DIR.
517
518 type displays a one character wide type field. This character is
519 similar to what is displayed by ls with the -F flag - * for exe‐
520 cutable files, / for directories, @ for links, = for sockets, -
521 for character devices, + for block devices, | for pipes, ~ for
522 symbolic links to directories and ! for stale symlinks (links
523 that point nowhere).
524
525 mark an asterisk if the file is tagged, a space if it's not.
526
527 mtime file's last modification time.
528
529 atime file's last access time.
530
531 ctime file's status change time.
532
533 perm a string representing the current permission bits of the file.
534
535 mode an octal value with the current permission bits of the file.
536
537 nlink the number of links to the file.
538
539 ngid the GID (numeric).
540
541 nuid the UID (numeric).
542
543 owner the owner of the file.
544
545 group the group of the file.
546
547 inode the inode of the file.
548
549 Also you can use following keywords to define the panel layout:
550
551 space a space in the display format.
552
553 | add a vertical line to the display format.
554
555 To force one field to a fixed size (a size specifier), you just add :
556 followed by the number of characters you want the field to have. If
557 the number is followed by the symbol +, then the size specifies the
558 minimal field size - if the program finds out that there is more space
559 on the screen, it will then expand that field.
560
561 For example, the Full display corresponds to this format:
562
563 half type name | size | mtime
564
565 And the Long display corresponds to this format:
566
567 full perm space nlink space owner space group space size space mtime
568 space name
569
570 This is a nice user display format:
571
572 half name | size:7 | type mode:3
573
574 Panels may also be set to the following modes:
575
576 Info The info view display information related to the currently
577 selected file and if possible information about the current file
578 system.
579
580 Tree The tree view is quite similar to the directory tree feature.
581 See the section about it for more information.
582
583 Quick View
584 In this mode, the panel will switch to a reduced viewer that
585 displays the contents of the currently selected file, if you
586 select the panel (with the tab key or the mouse), you will have
587 access to the usual viewer commands.
588
589 Sort Order...
590 The eight sort orders are by name, by extension, by modification time,
591 by access time, and by inode information modification time, by size, by
592 inode and unsorted. In the Sort order dialog box you can choose the
593 sort order and you may also specify if you want to sort in reverse
594 order by checking the reverse box.
595
596 By default directories are sorted before files but this can be changed
597 from the Options menu (option Mix all files).
598
599 Filter...
600 The filter command allows you to specify a shell pattern (for example
601 *.tar.gz) which the files must match to be shown. Regardless of the
602 filter pattern, the directories and the links to directories are always
603 shown in the directory panel.
604
605 Reread
606 The reread command reload the list of files in the directory. It is
607 useful if other processes have created or removed files. If you have
608 panelized file names in a panel this will reload the directory contents
609 and remove the panelized information (See the section External panelize
610 for more information).
611
612 File Menu
613 The Midnight Commander uses the F1 - F10 keys as keyboard shortcuts for
614 commands appearing in the file menu. The escape sequences for the
615 function keys are terminfo capabilities kf1 trough kf10. On terminals
616 without function key support, you can achieve the same functionality by
617 pressing the ESC key and then a number in the range 1 through 9 and 0
618 (corresponding to F1 to F9 and F10 respectively).
619
620 The File menu has the following commands (keyboard shortcuts in paren‐
621 theses):
622
623 Help (F1)
624
625 Invokes the built-in hypertext help viewer. Inside the help viewer, you
626 can use the Tab key to select the next link and the Enter key to follow
627 that link. The keys Space and Backspace are used to move forward and
628 backward in a help page. Press F1 again to get the full list of
629 accepted keys.
630
631 Menu (F2)
632
633 Invoke the user menu. The user menu provides an easy way to provide
634 users with a menu and add extra features to the Midnight Commander.
635
636 View (F3, Shift-F3)
637
638 View the currently selected file. By default this invokes the Internal
639 File Viewer but if the option "Use internal view" is off, it invokes an
640 external file viewer specified by the VIEWER environment variable. If
641 VIEWER is undefined, the PAGER environment variable is tried. If PAGER
642 is also undefined, the "view" command is invoked. If you use Shift-F3
643 instead, the viewer will be invoked without doing any formatting or
644 preprocessing to the file.
645
646 Filtered View (Alt-!)
647
648 This command prompts for a command and its arguments (the argument
649 defaults to the currently selected file name), the output from such
650 command is shown in the internal file viewer.
651
652 Edit (F4, F14)
653
654 Press F4 to edit the highlighted file. Press F14 (usually Shift-F4) to
655 start the editor with a new, empty file. Currently they invoke the vi
656 editor, or the editor specified in the EDITOR environment variable, or
657 the Internal File Editor if the use_internal_edit option is on.
658
659 Copy (F5, F15)
660
661 Press F5 to pop up an input dialog to copy the currently selected file
662 (or the tagged files, if there is at least one file tagged) to the
663 directory/filename you specify in the input dialog. The destination
664 defaults to the directory in the non-selected panel. During this
665 process, you can press C-c or ESC to abort the operation. For details
666 about source mask (which will be usually either * or ^\(.*\)$ depending
667 on setting of Use shell patterns) and possible wildcards in the desti‐
668 nation see Mask copy/rename.
669
670 F15 (usually Shift-F5) is similar, but defaults to the directory in the
671 selected panel. It always operates on the selected file, regardless of
672 any tagged files.
673
674 On some systems, it is possible to do the copy in the background by
675 clicking on the background button (or pressing Alt-b in the dialog
676 box). The Background Jobs is used to control the background process.
677
678 Link (C-x l)
679
680 Create a hard link to the current file.
681
682 SymLink (C-x s)
683
684 Create a symbolic link to the current file. To those of you who don't
685 know what links are: creating a link to a file is a bit like copying
686 the file, but both the source filename and the destination filename
687 represent the same file image. For example, if you edit one of these
688 files, all changes you make will appear in both files. Some people call
689 links aliases or shortcuts.
690
691 A hard link appears as a real file. After making it, there is no way of
692 telling which one is the original and which is the link. If you delete
693 either one of them the other one is still intact. It is very difficult
694 to notice that the files represent the same image. Use hard links when
695 you don't even want to know.
696
697 A symbolic link is a reference to the name of the original file. If the
698 original file is deleted the symbolic link is useless. It is quite easy
699 to notice that the files represent the same image. The Midnight Comman‐
700 der shows an "@"-sign in front of the file name if it is a symbolic
701 link to somewhere (except to directory, where it shows a tilde (~)).
702 The original file which the link points to is shown on mini-status line
703 if the Show mini-status option is enabled. Use symbolic links when you
704 want to avoid the confusion that can be caused by hard links.
705
706 Rename/Move (F6, F16)
707
708 Press F6 to pop up an input dialog to copy the currently selected file
709 (or the tagged files, if there is at least one file tagged) to the
710 directory/filename you specify in the input dialog. The destination
711 defaults to the directory in the non-selected panel. For more details
712 look at Copy (F5) operation above, most of the things are quite simi‐
713 lar.
714
715 F16 (usually Shift-F6) is similar, but defaults to the directory in the
716 selected panel. It always operates on the selected file, regardless of
717 any tagged files.
718
719 On some systems, it is possible to do the copy in the background by
720 clicking on the background button (or pressing Alt-b in the dialog
721 box). The Background Jobs is used to control the background process.
722
723 Mkdir (F7)
724
725 Pop up an input dialog and creates the directory specified.
726
727 Delete (F8)
728
729 Delete the currently selected file or the tagged files in the currently
730 selected panel. During the process, you can press C-c or ESC to abort
731 the operation.
732
733 Quick cd (Alt-c) Use the quick cd command if you have full command line
734 and want to cd somewhere.
735
736 Select group (+)
737
738 This is used to select (tag) a group of files. The Midnight Commander
739 will prompt for a regular expression describing the group. When Shell
740 Patterns are enabled, the regular expression is much like the filename
741 globbing in the shell (* standing for zero or more characters and ?
742 standing for one character). If Shell Patterns is off, then the tagging
743 of files is done with normal regular expressions (see ed (1)).
744
745 To mark directories instead of files, the expression must start or end
746 with a '/'.
747
748 Unselect group (\)
749
750 Used to unselect a group of files. This is the opposite of the Select
751 group command.
752
753 Quit (F10, Shift-F10)
754
755 Terminate the Midnight Commander. Shift-F10 is used when you want to
756 quit and you are using the shell wrapper. Shift-F10 will not take you
757 to the last directory you visited with the Midnight Commander, instead
758 it will stay at the directory where you started the Midnight Commander.
759
760 Quick cd
761 This command is useful if you have a full command line and want to cd
762 somewhere without having to yank and paste the command line. This com‐
763 mand pops up a small dialog, where you enter everything you would enter
764 after cd on the command line and then you press enter. This features
765 all the things that are already in the internal cd command.
766
767 Command Menu
768 The Directory tree command shows a tree figure of the directories.
769
770 The Find file command allows you to search for a specific file.
771
772 The "Swap panels" command swaps the contents of the two directory pan‐
773 els.
774
775 The "Panels on/off" command shows the output of the last shell command.
776 This works only on xterm and on Linux and FreeBSD console.
777
778 The Compare directories (C-x d) command compares the directory panels
779 with each other. You can then use the Copy (F5) command to make the
780 panels identical. There are three compare methods. The quick method
781 compares only file size and file date. The thorough method makes a full
782 byte-by-byte compare. The thorough method is not available if the
783 machine does not support the mmap(2) system call. The size-only com‐
784 pare method just compares the file sizes and does not check the con‐
785 tents or the date times, it just checks the file size.
786
787 The Command history command shows a list of typed commands. The
788 selected command is copied to the command line. The command history can
789 also be accessed by typing Alt-p or Alt-n.
790
791 The Directory hotlist (C-\) command makes changing of the current
792 directory to often used directories faster.
793
794 The External panelize allows you to execute an external program, and
795 make the output of that program the contents of the current panel.
796
797 Extension file edit command allows you to specify programs to executed
798 when you try to execute, view, edit and do a bunch of other thing on
799 files with certain extensions (filename endings). The Menu file edit
800 command may be used for editing the user menu (which appears by press‐
801 ing F2).
802
803 Directory Tree
804 The Directory Tree command shows a tree figure of the directories. You
805 can select a directory from the figure and the Midnight Commander will
806 change to that directory.
807
808 There are two ways to invoke the tree. The real directory tree command
809 is available from Commands menu. The other way is to select tree view
810 from the Left or Right menu.
811
812 To get rid of long delays the Midnight Commander creates the tree fig‐
813 ure by scanning only a small subset of all the directories. If the
814 directory which you want to see is missing, move to its parent direc‐
815 tory and press C-r (or F2).
816
817 You can use the following keys:
818
819 General movement keys are accepted.
820
821 Enter. In the directory tree, exits the directory tree and changes to
822 this directory in the current panel. In the tree view, changes to this
823 directory in the other panel and stays in tree view mode in the current
824 panel.
825
826 C-r, F2 (Rescan). Rescan this directory. Use this when the tree figure
827 is out of date: it is missing subdirectories or shows some subdirecto‐
828 ries which don't exist any more.
829
830 F3 (Forget). Delete this directory from the tree figure. Use this to
831 remove clutter from the figure. If you want the directory back to the
832 tree figure press F2 in its parent directory.
833
834 F4 (Static/Dynamic). Toggle between the dynamic navigation mode
835 (default) and the static navigation mode.
836
837 In the static navigation mode you can use the Up and Down keys to
838 select a directory. All known directories are shown.
839
840 In the dynamic navigation mode you can use the Up and Down keys to
841 select a sibling directory, the Left key to move to the parent direc‐
842 tory, and the Right key to move to a child directory. Only the parent,
843 sibling and children directories are shown, others are left out. The
844 tree figure changes dynamically as you traverse.
845
846 F5 (Copy). Copy the directory.
847
848 F6 (RenMov). Move the directory.
849
850 F7 (Mkdir). Make a new directory below this directory.
851
852 F8 (Delete). Delete this directory from the file system.
853
854 C-s, Alt-s. Search the next directory matching the search string. If
855 there is no such directory these keys will move one line down.
856
857 C-h, Backspace. Delete the last character of the search string.
858
859 Any other character. Add the character to the search string and move
860 to the next directory which starts with these characters. In the tree
861 view you must first activate the search mode by pressing C-s. The
862 search string is shown in the mini status line.
863
864 The following actions are available only in the directory tree. They
865 aren't supported in the tree view.
866
867 F1 (Help). Invoke the help viewer and show this section.
868
869 Esc, F10. Exit the directory tree. Do not change the directory.
870
871 The mouse is supported. A double-click behaves like Enter. See also the
872 section on mouse support.
873
874 Find File
875 The Find File feature first asks for the start directory for the search
876 and the filename to be searched for. By pressing the Tree button you
877 can select the start directory from the directory tree figure.
878
879 The contents field accepts regular expressions similar to egrep(1).
880 That means you have to escape characters with a special meaning to
881 egrep with "\", e.g. if you search for "strcmp (" you will have to
882 input "strcmp \(" (without the double quotes).
883
884 You can start the search by pressing the OK button. During the search
885 you can stop from the Stop button and continue from the Start button.
886
887 You can browse the filelist with the up and down arrow keys. The Chdir
888 button will change to the directory of the currently selected file. The
889 Again button will ask for the parameters for a new search. The Quit
890 button quits the search operation. The Panelize button will place the
891 found files to the current directory panel so that you can do addi‐
892 tional operations on them (view, copy, move, delete and so on). After
893 panelizing you can press C-r to return to the normal file listing.
894
895 It is possible to have a list of directories that the Find File command
896 should skip during the search (for example, you may want to avoid
897 searches on a CD-ROM or on a NFS directory that is mounted across a
898 slow link).
899
900 Directories to be skipped should be set on the variable
901 find_ignore_dirs in the Misc section of your ~/.mc/ini file.
902
903 Directory components should be separated with a colon, here is an exam‐
904 ple:
905
906 [Misc]
907 find_ignore_dirs=/cdrom:/nfs/wuarchive:/afs
908
909 You may consider using the External panelize command for some opera‐
910 tions. Find file command is for simple queries only, while using Exter‐
911 nal panelize you can do as mysterious searches as you would like.
912
913 External panelize
914 The External panelize allows you to execute an external program, and
915 make the output of that program the contents of the current panel.
916
917 For example, if you want to manipulate in one of the panels all the
918 symbolic links in the current directory, you can use external paneliza‐
919 tion to run the following command:
920
921 find . -type l -print
922
923 Upon command completion, the directory contents of the panel will no
924 longer be the directory listing of the current directory, but all the
925 files that are symbolic links.
926
927 If you want to panelize all of the files that have been downloaded from
928 your FTP server, you can use this awk command to extract the file name
929 from the transfer log files:
930
931 awk '$9 ~! /incoming/ { print $9 }' < /usr/adm/xferlog
932
933 You may want to save often used panelize commands under a descriptive
934 name, so that you can recall them quickly. You do this by typing the
935 command on the input line and pressing Add new button. Then you enter a
936 name under which you want the command to be saved. Next time, you just
937 choose that command from the list and do not have to type it again.
938
939 Hotlist
940 The Directory hotlist command shows the labels of the directories in
941 the directory hotlist. The Midnight Commander will change to the
942 directory corresponding to the selected label. From the hotlist dia‐
943 log, you can remove already created label/directory pairs and add new
944 ones. To add new directories quickly, you can use the Add to hotlist
945 command (C-x h), which adds the current directory into the directory
946 hotlist, asking just for the label for the directory.
947
948 This makes cd to often used directories faster. You may consider using
949 the CDPATH variable as described in internal cd command description.
950
951 Extension File Edit
952 This will invoke your editor on the file ~/.mc/bindings. The format of
953 this file following:
954
955 All lines starting with # or empty lines are thrown away.
956
957 Lines starting in the first column should have following format:
958
959 keyword/expr, i.e. everything after the slash until new line is expr.
960
961 keyword can be:
962
963 shell - expr is an extension (no wildcards). File matches it its name
964 ends with expr. Example: shell/.tar matches *.tar.
965
966 regex - expr is a regular expression. File matches if its name
967 matches the regular expression.
968
969 directory
970 - expr is a regular expression. File matches if it is a direc‐
971 tory and its name matches the regular expression.
972
973 type - expr is a regular expression. File matches if the output of
974 file %f without the initial "filename:" part matches regular
975 expression expr.
976
977 default
978 - matches any file. expr is ignored.
979
980 include
981 - denotes a common section. expr is the name of the section.
982
983 Other lines should start with a space or tab and should be of the for‐
984 mat: keyword=command (with no spaces around =), where keyword should
985 be: Open (invoked on Enter or double click), View (F3), Edit (F4) or
986 Include (to add rules from the common section). command is any one-
987 line shell command, with the simple macro substitution.
988
989 Rules are matched from top to bottom, thus the order is important. If
990 the appropriate action is missing, search continues as if this rule
991 didn't match (i.e. if a file matches the first and second entry and
992 View action is missing in the first one, then on pressing F3 the View
993 action from the second entry will be used). default should match all
994 the actions.
995
996 Background Jobs
997 This lets you control the state of any background Midnight Commander
998 process (only copy and move files operations can be done in the back‐
999 ground). You can stop, restart and kill a background job from here.
1000
1001 Menu File Edit
1002 The user menu is a menu of useful actions that can be customized by the
1003 user. When you access the user menu, the file .mc.menu from the current
1004 directory is used if it exists, but only if it is owned by user or root
1005 and is not world-writable. If no such file found, ~/.mc/menu is tried
1006 in the same way, and otherwise mc uses the default system-wide menu
1007 /usr/share/mc/mc.menu.
1008
1009 The format of the menu file is very simple. Lines that start with any‐
1010 thing but space or tab are considered entries for the menu (in order to
1011 be able to use it like a hot key, the first character should be a let‐
1012 ter). All the lines that start with a space or a tab are the commands
1013 that will be executed when the entry is selected.
1014
1015 When an option is selected all the command lines of the option are
1016 copied to a temporary file in the temporary directory (usually
1017 /usr/tmp) and then that file is executed. This allows the user to put
1018 normal shell constructs in the menus. Also simple macro substitution
1019 takes place before executing the menu code. For more information, see
1020 macro substitution.
1021
1022 Here is a sample mc.menu file:
1023
1024 A Dump the currently selected file
1025 od -c %f
1026
1027 B Edit a bug report and send it to root
1028 I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1
1029 vi $I
1030 mail -s "Midnight Commander bug" root < $I
1031 rm -f $I
1032
1033 M Read mail
1034 emacs -f rmail
1035
1036 N Read Usenet news
1037 emacs -f gnus
1038
1039 H Call the info hypertext browser
1040 info
1041
1042 J Copy current directory to other panel recursively
1043 tar cf - . | (cd %D && tar xvpf -)
1044
1045 K Make a release of the current subdirectory
1046 echo -n "Name of distribution file: "
1047 read tar
1048 ln -s %d `dirname %d`/$tar
1049 cd ..
1050 tar cvhf ${tar}.tar $tar
1051
1052 = f *.tar.gz | f *.tgz & t n
1053 X Extract the contents of a compressed tar file
1054 tar xzvf %f
1055
1056 Default Conditions
1057
1058 Each menu entry may be preceded by a condition. The condition must
1059 start from the first column with a '=' character. If the condition is
1060 true, the menu entry will be the default entry.
1061
1062 Condition syntax: = <sub-cond>
1063 or: = <sub-cond> | <sub-cond> ...
1064 or: = <sub-cond> & <sub-cond> ...
1065
1066 Sub-condition is one of following:
1067
1068 y <pattern> syntax of current file matching pattern?
1069 (for edit menu only)
1070 f <pattern> current file matching pattern?
1071 F <pattern> other file matching pattern?
1072 d <pattern> current directory matching pattern?
1073 D <pattern> other directory matching pattern?
1074 t <type> current file of type?
1075 T <type> other file of type?
1076 x <filename> is it executable filename?
1077 ! <sub-cond> negate the result of sub-condition
1078
1079 Pattern is a normal shell pattern or a regular expression, according to
1080 the shell patterns option. You can override the global value of the
1081 shell patterns option by writing "shell_patterns=x" on the first line
1082 of the menu file (where "x" is either 0 or 1).
1083
1084 Type is one or more of the following characters:
1085
1086 n not a directory
1087 r regular file
1088 d directory
1089 l link
1090 c character device
1091 b block device
1092 f FIFO (pipe)
1093 s socket
1094 x executable file
1095 t tagged
1096
1097 For example 'rlf' means either regular file, link or fifo. The 't' type
1098 is a little special because it acts on the panel instead of the file.
1099 The condition '=t t' is true if there are tagged files in the current
1100 panel and false if not.
1101
1102 If the condition starts with '=?' instead of '=' a debug trace will be
1103 shown whenever the value of the condition is calculated.
1104
1105 The conditions are calculated from left to right. This means
1106 = f *.tar.gz | f *.tgz & t n
1107 is calculated as
1108 ( (f *.tar.gz) | (f *.tgz) ) & (t n)
1109
1110 Here is a sample of the use of conditions:
1111
1112 = f *.tar.gz | f *.tgz & t n
1113 L List the contents of a compressed tar-archive
1114 gzip -cd %f | tar xvf -
1115
1116 Addition Conditions
1117
1118 If the condition begins with '+' (or '+?') instead of '=' (or '=?') it
1119 is an addition condition. If the condition is true the menu entry will
1120 be included in the menu. If the condition is false the menu entry will
1121 not be included in the menu.
1122
1123 You can combine default and addition conditions by starting condition
1124 with '+=' or '=+' (or '+=?' or '=+?' if you want debug trace). If you
1125 want to use two different conditions, one for adding and another for
1126 defaulting, you can precede a menu entry with two condition lines, one
1127 starting with '+' and another starting with '='.
1128
1129 Comments are started with '#'. The additional comment lines must start
1130 with '#', space or tab.
1131
1132 Options Menu
1133 The Midnight Commander has some options that may be toggled on and off
1134 in several dialogs which are accessible from this menu. Options are
1135 enabled if they have an asterisk or "x" in front of them.
1136
1137 The Configuration command pops up a dialog from which you can change
1138 most of settings of the Midnight Commander.
1139
1140 The Layout command pops up a dialog from which you specify a bunch of
1141 options how mc looks like on the screen.
1142
1143 The Confirmation command pops up a dialog from which you specify which
1144 actions you want to confirm.
1145
1146 The Display bits command pops up a dialog from which you may select
1147 which characters is your terminal able to display.
1148
1149 The Learn keys command pops up a dialog from which you test some keys
1150 which are not working on some terminals and you may fix them.
1151
1152 The Virtual FS command pops up a dialog from which you specify some VFS
1153 related options.
1154
1155 The Save setup command saves the current settings of the Left, Right
1156 and Options menus. A small number of other settings is saved, too.
1157
1158 Configuration
1159 The options in this dialog are divided into three groups: Panel
1160 Options, Pause after run and Other Options.
1161
1162 Panel Options
1163
1164 Show Backup Files. If enabled, the Midnight Commander will show files
1165 ending with a tilde. Otherwise, they won't be shown (like GNU's ls
1166 option -B).
1167
1168 Show Hidden Files. If enabled, the Midnight Commander will show all
1169 files that start with a dot (like ls -a).
1170
1171 Mark moves down. If enabled, the selection bar will move down when you
1172 mark a file (with either C-t or the Insert key).
1173
1174 Drop down menus. When this option is enabled, the pull down menus will
1175 be activated as soon as you press the F9 key. Otherwise, you will only
1176 get the menu title, and you will have to activate the menu either with
1177 the arrow keys or with the hotkeys. It is recommended if you are using
1178 hotkeys.
1179
1180 Mix all files. If this option is enabled, all files and directories
1181 are shown mixed together. If the option is off, directories (and links
1182 to directories) are shown at the beginning of the listing, and other
1183 files below.
1184
1185 Fast directory reload. If this option is enabled, the Midnight Comman‐
1186 der will use a trick to determine if the directory contents have
1187 changed. The trick is to reload the directory only if the i-node of
1188 the directory has changed; this means that reloads only happen when
1189 files are created or deleted. If what changes is the i-node for a file
1190 in the directory (file size changes, mode or owner changes, etc) the
1191 display is not updated. In these cases, if you have the option on, you
1192 have to rescan the directory manually (with C-r).
1193
1194 Pause after run
1195
1196 After executing your commands, the Midnight Commander can pause, so
1197 that you can examine the output of the command. There are three possi‐
1198 ble settings for this variable:
1199
1200 Never. Means that you do not want to see the output of your command.
1201 If you are using the Linux or FreeBSD console or an xterm, you will be
1202 able to see the output of the command by typing C-o.
1203
1204 On dumb terminals. You will get the pause message on terminals that
1205 are not capable of showing the output of the last command executed (any
1206 terminal that is not an xterm or the Linux console).
1207
1208 Always. The program will pause after executing all of your commands.
1209
1210 Other Options
1211
1212 Verbose operation. This toggles whether the file Copy, Rename and
1213 Delete operations are verbose (i.e., display a dialog box for each
1214 operation). If you have a slow terminal, you may wish to disable the
1215 verbose operation. It is automatically turned off if the speed of your
1216 terminal is less than 9600 bps.
1217
1218 Compute totals. If this option is enabled, the Midnight Commander com‐
1219 putes total byte sizes and total number of files prior to any Copy,
1220 Rename and Delete operations. This will provide you with a more accu‐
1221 rate progress bar at the expense of some speed. This option has no
1222 effect, if Verbose operation is disabled.
1223
1224 Shell Patterns. By default the Select, Unselect and Filter commands
1225 will use shell-like regular expressions. The following conversions are
1226 performed to achieve this: the '*' is replaced by '.*' (zero or more
1227 characters); the '?' is replaced by '.' (exactly one character) and
1228 '.' by the literal dot. If the option is disabled, then the regular
1229 expressions are the ones described in ed(1).
1230
1231 Auto Save Setup. If this option is enabled, when you exit the Midnight
1232 Commander the configurable options of the Midnight Commander are saved
1233 in the ~/.mc/ini file.
1234
1235 Auto menus. If this option is enabled, the user menu will be invoked
1236 at startup. Useful for building menus for non-unixers.
1237
1238 Use internal editor. If this option is enabled, the built-in file edi‐
1239 tor is used to edit files. If the option is disabled, the editor speci‐
1240 fied in the EDITOR environment variable is used. If no editor is spec‐
1241 ified, vi is used. See the section on the internal file editor.
1242
1243 Use internal viewer. If this option is enabled, the built-in file
1244 viewer is used to view files. If the option is disabled, the pager
1245 specified in the PAGER environment variable is used. If no pager is
1246 specified, the view command is used. See the section on the internal
1247 file viewer.
1248
1249 Complete: show all. By default the Midnight Commander pops up all pos‐
1250 sible completions if the completion is ambiguous only when you press
1251 Alt-Tab for the second time. For the first time, it just completes as
1252 much as possible and beeps in the case of ambiguity. Enable this
1253 option if you want to see all possible completions even after pressing
1254 Alt-Tab the first time.
1255
1256 Rotating dash. If this option is enabled, the Midnight Commander shows
1257 a rotating dash in the upper right corner as a work in progress indica‐
1258 tor.
1259
1260 Lynx-like motion. If this option is enabled, you may use the arrows
1261 keys to automatically chdir if the current selection is a subdirectory
1262 and the shell command line is empty. By default, this setting is off.
1263
1264 Cd follows links. This option, if set, causes the Midnight Commander
1265 to follow the logical chain of directories when changing current direc‐
1266 tory either in the panels, or using the cd command. This is the default
1267 behavior of bash. When unset, the Midnight Commander follows the real
1268 directory structure, so cd .. if you've entered that directory through
1269 a link will move you to the current directory's real parent and not to
1270 the directory where the link was present.
1271
1272 Safe delete. If this option is enabled, deleting files and directory
1273 hotlist entries unintentionally becomes more difficult. The default
1274 selection in the confirmation dialogs for deletion changes from "Yes"
1275 to "No". This option is disabled by default.
1276
1277 Layout
1278 The layout dialog gives you a possibility to change the general layout
1279 of screen. You can specify whether the menubar, the command prompt, the
1280 hintbar and the function keybar are visible. On the Linux or FreeBSD
1281 console you can specify how many lines are shown in the output window.
1282
1283 The rest of the screen area is used for the two directory panels. You
1284 can specify whether the area is split to the panels in vertical or hor‐
1285 izontal direction. The split can be equal or you can specify an unequal
1286 split.
1287
1288 You can specify whether permissions and file types should be high‐
1289 lighted with distinctive Colors. If the permission highlighting is
1290 enabled, the parts of the perm and mode display fields which apply to
1291 the user running Midnight Commander are highlighted with the color
1292 defined by the selected keyword. If the file type highlighting is
1293 enabled, files are colored according to their file type (e.g. direc‐
1294 tory, core file, executable, and so on).
1295
1296 If the Show Mini-Status option is enabled, one line of status informa‐
1297 tion about the currently selected item is shown at the bottom of the
1298 panels.
1299
1300 When run in a terminal emulator for X11, Midnight Commander sets the
1301 terminal window title to the current working directory and updates it
1302 when necessary. If your terminal emulator is broken and you see some
1303 incorrect output on startup and directory change, turn off the Xterm
1304 Window Title option.
1305
1306 Confirmation
1307 In this menu you configure the confirmation options for file deletion,
1308 directory hotlist entries deletion, overwriting, execution by pressing
1309 enter and quitting the program.
1310
1311 Display bits
1312 This is used to configure the range of visible characters on the
1313 screen. This setting may be 7-bits if your terminal/curses supports
1314 only seven output bits, ISO-8859-1 displays all the characters in the
1315 ISO-8859-1 map and full 8 bits is for those terminals that can display
1316 full 8 bit characters.
1317
1318 Learn keys
1319 This dialog allows you to test and redefine functional keys, cursor
1320 arrows and some other keys to make them work properly on your terminal.
1321 They often don't, since many terminal databases are incomplete or bro‐
1322 ken.
1323
1324 You can move around with the Tab key and with the vi moving keys ('h'
1325 left, 'j' down, 'k' up and 'l' right). Once you press any cursor move‐
1326 ment key and it is recognized, you can use that key as well.
1327
1328 You can test keys just by pressing each of them. When you press a key
1329 and it is recognized properly, OK should appear next to the name of
1330 that key. Once a key is marked OK it starts working as usually, e.g.
1331 F1 pressed the first time will just check that the F1 key works, but
1332 after that it will show help. The same applies to the arrow keys. The
1333 Tab key should be working always.
1334
1335 If some keys do not work properly then you won't see OK appear after
1336 pressing one of these. Then you may want to redefine it. Do it by
1337 pressing the button with the name of that key (either by the mouse or
1338 by Enter or Space after selecting the button with Tab or arrows). Then
1339 a message box will appear asking you to press that key. Do it and wait
1340 until the message box disappears. If you want to abort, just press
1341 Escape once and wait.
1342
1343 When you finish with all the keys, you can Save them. The definitions
1344 for the keys you have redefined will be written into the [termi‐
1345 nal:TERM] section of your ~/.mc/ini file (where TERM is the name of
1346 your current terminal). The definitions of the keys that were already
1347 working properly are not saved.
1348
1349 Virtual FS
1350 This option gives you control over the settings of the Virtual File
1351 System.
1352
1353 The Midnight Commander keeps in memory the information related to some
1354 of the virtual file systems to speed up the access to the files in the
1355 file system (for example, directory listings fetched from FTP servers).
1356
1357 Also, in order to access the contents of compressed files (for example,
1358 compressed tar files) the Midnight Commander needs to create temporary
1359 uncompressed files on your disk.
1360
1361 Since both the information in memory and the temporary files on disk
1362 take up resources, you may want to tune the parameters of the cached
1363 information to decrease your resource usage or to maximize the speed of
1364 access to frequently used file systems.
1365
1366 Because of the format of the tar archives, the Tar filesystem needs to
1367 read the whole file just to load the file entries. Since most tar
1368 files are usually kept compressed (plain tar files are species in
1369 extinction), the tar file system has to uncompress the file on the disk
1370 in a temporary location and then access the uncompressed file as a reg‐
1371 ular tar file.
1372
1373 Now, since we all love to browse files and tar files all over the disk,
1374 it's common that you will leave a tar file and the re-enter it later.
1375 Since decompression is slow, the Midnight Commander will cache the
1376 information in memory for a limited time. When the timeout expires,
1377 all the resources associated with the file system are released. The
1378 default timeout is set to one minute.
1379
1380 The FTP File System (ftpfs) allows you to browse directories on remote
1381 FTP servers. It has several options.
1382
1383 ftp anonymous password is the password used when you login as "anony‐
1384 mous". Some sites require a valid e-mail address. On the other hand,
1385 you probably don't want to give your real e-mail address to untrusted
1386 sites, especially if you are not using spam filtering.
1387
1388 ftpfs keeps the directory listing it fetches from a FTP server in a
1389 cache. The cache expire time is configurable with the ftpfs directory
1390 cache timeout option. A low value for this option may slow down every
1391 operation on the ftpfs because every operation would require sending a
1392 request to the FTP server.
1393
1394 You can define an FTP proxy host for doing FTP. Note that most modern
1395 firewalls are fully transparent at least for passive FTP (see below),
1396 so FTP proxies are considered obsolete.
1397
1398 If Always use ftp proxy is not set, you can use the exclamation sign to
1399 enable proxy for certain hosts. See FTP File System for examples.
1400
1401 If this option is set, the program will do two things: consult the
1402 /usr/lib/mc/mc.no_proxy file for lines containing host names that are
1403 local (if the host name starts with a dot, it is assumed to be a
1404 domain) and to assume that any hostnames without dots in their names
1405 are directly accessible. All other hosts will be accessed through the
1406 specified FTP proxy.
1407
1408 You can enable using ~/.netrc file, which keeps login names and pass‐
1409 words for ftp servers. See netrc (5) for the description of the .netrc
1410 format.
1411
1412 Use passive mode enables using FTP passive mode, when the connection
1413 for data transfer is initiated by the client, not by the server. This
1414 option is recommended and enabled by default. If this option is turned
1415 off, the data connection is initiated by the server. This may not work
1416 with some firewalls.
1417
1418 Save Setup
1419 At startup the Midnight Commander will try to load initialization
1420 information from the ~/.mc/ini file. If this file doesn't exist, it
1421 will load the information from the system-wide configuration file,
1422 located in /usr/share/mc/mc.ini. If the system-wide configuration file
1423 doesn't exist, MC uses the default settings.
1424
1425 The Save Setup command creates the ~/.mc/ini file by saving the current
1426 settings of the Left, Right and Options menus.
1427
1428 If you activate the auto save setup option, MC will always save the
1429 current settings when exiting.
1430
1431 There also exist settings which can't be changed from the menus. To
1432 change these settings you have to edit the setup file with your
1433 favorite editor. See the section on Special Settings for more informa‐
1434 tion.
1435
1436
1438 You may execute commands by typing them directly in the Midnight Com‐
1439 mander's input line, or by selecting the program you want to execute
1440 with the selection bar in one of the panels and hitting Enter.
1441
1442 If you press Enter over a file that is not executable, the Midnight
1443 Commander checks the extension of the selected file against the exten‐
1444 sions in the Extensions File. If a match is found then the code asso‐
1445 ciated with that extension is executed. A very simple macro expansion
1446 takes place before executing the command.
1447
1448 The cd internal command
1449 The cd command is interpreted by the Midnight Commander, it is not
1450 passed to the command shell for execution. Thus it may not handle all
1451 of the nice macro expansion and substitution that your shell does,
1452 although it does some of them:
1453
1454 Tilde substitution. The (~) will be substituted with your home direc‐
1455 tory, if you append a username after the tilde, then it will be substi‐
1456 tuted with the login directory of the specified user.
1457
1458 For example, ~guest is the home directory for the user guest, while
1459 ~/guest is the directory guest in your home directory.
1460
1461 Previous directory. You can jump to the directory you were previously
1462 by using the special directory name '-' like this: cd -
1463
1464 CDPATH directories. If the directory specified to the cd command is
1465 not in the current directory, then The Midnight Commander uses the
1466 value in the environment variable CDPATH to search for the directory in
1467 any of the named directories.
1468
1469 For example you could set your CDPATH variable to ~/src:/usr/src,
1470 allowing you to change your directory to any of the directories inside
1471 the ~/src and /usr/src directories, from any place in the file system
1472 by using its relative name (for example cd linux could take you to
1473 /usr/src/linux).
1474
1475 Macro Substitution
1476 When accessing a user menu, or executing an extension dependent com‐
1477 mand, or running a command from the command line input, a simple macro
1478 substitution takes place.
1479
1480 The macros are:
1481
1482 %i The indent of blank space, equal the cursor column position.
1483 For edit menu only.
1484
1485 %y The syntax type of current file. For edit menu only.
1486
1487 %k The block file name.
1488
1489 %e The error file name.
1490
1491 %m The current menu name.
1492
1493 %f and %p
1494 The current file name.
1495
1496 %x The extension of current file name.
1497
1498 %b The current file name without extension.
1499
1500 %d The current directory name.
1501
1502 %F The current file in the unselected panel.
1503
1504 %D The directory name of the unselected panel.
1505
1506 %t The currently tagged files.
1507
1508 %T The tagged files in the unselected panel.
1509
1510 %u and %U
1511 Similar to the %t and %T macros, but in addition the files are
1512 untagged. You can use this macro only once per menu file entry
1513 or extension file entry, because next time there will be no
1514 tagged files.
1515
1516 %s and %S
1517 The selected files: The tagged files if there are any. Otherwise
1518 the current file.
1519
1520 %cd This is a special macro that is used to change the current
1521 directory to the directory specified in front of it. This is
1522 used primarily as an interface to the Virtual File System.
1523
1524 %view This macro is used to invoke the internal viewer. This macro
1525 can be used alone, or with arguments. If you pass any arguments
1526 to this macro, they should be enclosed in brackets.
1527
1528 The arguments are: ascii to force the viewer into ascii mode;
1529 hex to force the viewer into hex mode; nroff to tell the viewer
1530 that it should interpret the bold and underline sequences of
1531 nroff; unformatted to tell the viewer to not interpret nroff
1532 commands for making the text bold or underlined.
1533
1534 %% The % character
1535
1536 %{some text}
1537 Prompt for the substitution. An input box is shown and the text
1538 inside the braces is used as a prompt. The macro is substituted
1539 by the text typed by the user. The user can press ESC or F10 to
1540 cancel. This macro doesn't work on the command line yet.
1541
1542 %var{ENV:default}
1543 If environment variable ENV is unset, the default is substi‐
1544 tuted. Otherwise, the value of ENV is substituted.
1545
1546 The subshell support
1547 The subshell support is a compile time option, that works with the
1548 shells: bash, tcsh and zsh.
1549
1550 When the subshell code is activated the Midnight Commander will spawn a
1551 concurrent copy of your shell (the one defined in the SHELL variable
1552 and if it is not defined, then the one in the /etc/passwd file) and run
1553 it in a pseudo terminal, instead of invoking a new shell each time you
1554 execute a command, the command will be passed to the subshell as if you
1555 had typed it. This also allows you to change the environment vari‐
1556 ables, use shell functions and define aliases that are valid until you
1557 quit the Midnight Commander.
1558
1559 If you are using bash you can specify startup commands for the subshell
1560 in your ~/.mc/bashrc file and special keyboard maps in the ~/.mc/inpu‐
1561 trc file. tcsh users may specify startup commands in the ~/.mc/tcshrc
1562 file.
1563
1564 When the subshell code is used, you can suspend applications at any
1565 time with the sequence C-o and jump back to the Midnight Commander, if
1566 you interrupt an application, you will not be able to run other exter‐
1567 nal commands until you quit the application you interrupted.
1568
1569 An extra added feature of using the subshell is that the prompt dis‐
1570 played by the Midnight Commander is the same prompt that you are cur‐
1571 rently using in your shell.
1572
1573 The OPTIONS section has more information on how you can control the
1574 subshell code.
1575
1577 The Chmod window is used to change the attribute bits in a group of
1578 files and directories. It can be invoked with the C-x c key combina‐
1579 tion.
1580
1581 The Chmod window has two parts - Permissions and File.
1582
1583 In the File section are displayed the name of the file or directory and
1584 its permissions in octal form, as well as its owner and group.
1585
1586 In the Permissions section there is a set of check buttons which corre‐
1587 spond to the file attribute bits. As you change the attribute bits,
1588 you can see the octal value change in the File section.
1589
1590 To move between the widgets (buttons and check buttons) use the arrow
1591 keys or the Tab key. To change the state of the check buttons or to
1592 select a button use Space. You can also use the hotkeys on the buttons
1593 to quickly activate them. Hotkeys are shown as highlighted letters on
1594 the buttons.
1595
1596 To set the attribute bits, use the Enter key.
1597
1598 When working with a group of files or directories, you just click on
1599 the bits you want to set or clear. Once you have selected the bits you
1600 want to change, you select one of the action buttons (Set marked or
1601 Clear marked).
1602
1603 Finally, to set the attributes exactly to those specified, you can use
1604 the [Set all] button, which will act on all the tagged files.
1605
1606 [Marked all] set only marked attributes to all selected files
1607
1608 [Set marked] set marked bits in attributes of all selected files
1609
1610 [Clean marked] clear marked bits in attributes of all selected files
1611
1612 [Set] set the attributes of one file
1613
1614 [Cancel] cancel the Chmod command
1615
1617 The Chown command is used to change the owner/group of a file. The hot
1618 key for this command is C-x o.
1619
1621 The Advanced Chown command is the Chmod and Chown command combined into
1622 one window. You can change the permissions and owner/group of files at
1623 once.
1624
1626 When you copy, move or delete files the Midnight Commander shows the
1627 file operations dialog. It shows the files currently being processed
1628 and uses up to three progress bars. The file bar indicates the per‐
1629 centage of the current file that has been processed so far. The count
1630 bar shows how many of the tagged files have been handled. The bytes
1631 bar indicates the percentage of the total size of the tagged files that
1632 has been handled. If the verbose option is off, the file and bytes
1633 bars are not shown.
1634
1635 There are two buttons at the bottom of the dialog. Pressing the Skip
1636 button will skip the rest of the current file. Pressing the Abort but‐
1637 ton will abort the whole operation, the rest of the files are skipped.
1638
1639 There are three other dialogs which you can run into during the file
1640 operations.
1641
1642 The error dialog informs about error conditions and has three choices.
1643 Normally you select either the Skip button to skip the file or the
1644 Abort button to abort the operation altogether. You can also select
1645 the Retry button if you fixed the problem from another terminal.
1646
1647 The replace dialog is shown when you attempt to copy or move a file on
1648 the top of an existing file. The dialog shows the dates and sizes of
1649 the both files. Press the Yes button to overwrite the file, the No
1650 button to skip the file, the All button to overwrite all the files, the
1651 None button to never overwrite and the Update button to overwrite if
1652 the source file is newer than the target file. You can abort the whole
1653 operation by pressing the Abort button.
1654
1655 The recursive delete dialog is shown when you try to delete a directory
1656 which is not empty. Press the Yes button to delete the directory
1657 recursively, the No button to skip the directory, the All button to
1658 delete all the directories and the None button to skip all the non-
1659 empty directories. You can abort the whole operation by pressing the
1660 Abort button. If you selected the Yes or All button you will be asked
1661 for a confirmation. Type "yes" only if you are really sure you want to
1662 do the recursive delete.
1663
1664 If you have tagged files and perform an operation on them only the
1665 files on which the operation succeeded are untagged. Failed and skipped
1666 files are left tagged.
1667
1669 The copy/move operations let you translate the names of files in an
1670 easy way. To do it, you have to specify the correct source mask and
1671 usually in the trailing part of the destination specify some wildcards.
1672 All the files matching the source mask are copied/renamed according to
1673 the target mask. If there are tagged files, only the tagged files
1674 matching the source mask are renamed.
1675
1676 There are other options which you can set:
1677
1678 Follow links
1679
1680 determines whether make the symlinks and hardlinks in the source direc‐
1681 tory (recursively in subdirectories) new links in the target directory
1682 or whether would you like to copy their content.
1683
1684 Dive into subdirs
1685
1686 determines the behavior when the source directory is about to be
1687 copied, but the target directory already exists. The default action is
1688 to copy the contents of the source directory into the target directory.
1689 Enabling this option causes copying the source directory itself into
1690 the target directory.
1691
1692 For example, you want to copy directory /foo containing file bar to
1693 /bla/foo, which is an already existing directory. Normally (when Dive
1694 into subdirs is not set), mc would copy file /foo/bar into the file
1695 /bla/foo/bar. By enabling this option the /bla/foo/foo directory will
1696 be created, and /foo/bar will be copied into /bla/foo/foo/bar.
1697
1698 Preserve attributes
1699
1700 determines whether to preserve the permissions, timestamps and (if you
1701 are root) the ownership of the original files. If this option is not
1702 set, the current value of the umask will be respected.
1703
1704 Use shell patterns on
1705
1706 When the shell patterns option is on you can use the '*' and '?' wild‐
1707 cards in the source mask. They work like they do in the shell. In the
1708 target mask only the '*' and '\<digit>' wildcards are allowed. The
1709 first '*' wildcard in the target mask corresponds to the first wildcard
1710 group in the source mask, the second '*' corresponds to the second
1711 group and so on. The '\1' wildcard corresponds to the first wildcard
1712 group in the source mask, the '\2' wildcard corresponds to the second
1713 group and so on all the way up to '\9'. The '\0' wildcard is the whole
1714 filename of the source file.
1715
1716 Two examples:
1717
1718 If the source mask is "*.tar.gz", the destination is "/bla/*.tgz" and
1719 the file to be copied is "foo.tar.gz", the copy will be "foo.tgz" in
1720 "/bla".
1721
1722 Suppose you want to swap basename and extension so that "file.c" would
1723 become "c.file" and so on. The source mask for this is "*.*" and the
1724 destination is "\2.\1".
1725
1726 Use shell patterns off
1727
1728 When the shell patterns option is off the MC doesn't do automatic
1729 grouping anymore. You must use '\(...\)' expressions in the source mask
1730 to specify meaning for the wildcards in the target mask. This is more
1731 flexible but also requires more typing. Otherwise target masks are sim‐
1732 ilar to the situation when the shell patterns option is on.
1733
1734 Two examples:
1735
1736 If the source mask is "^\(.*\)\.tar\.gz$", the destination is
1737 "/bla/*.tgz" and the file to be copied is "foo.tar.gz", the copy will
1738 be "/bla/foo.tgz".
1739
1740 Let's suppose you want to swap basename and extension so that "file.c"
1741 will become "c.file" and so on. The source mask for this is
1742 "^\(.*\)\.\(.*\)$" and the destination is "\2.\1".
1743
1744 Case Conversions
1745
1746 You can also change the case of the filenames. If you use '\u' or '\l'
1747 in the target mask, the next character will be converted to uppercase
1748 or lowercase correspondingly.
1749
1750 If you use '\U' or '\L' in the target mask, the next characters will be
1751 converted to uppercase or lowercase correspondingly up to the next '\E'
1752 or next '\U', '\L' or the end of the file name.
1753
1754 The '\u' and '\l' are stronger than '\U' and '\L'.
1755
1756 For example, if the source mask is '*' (shell patterns on) or
1757 '^\(.*\)$' (shell patterns off) and the target mask is '\L\u*' the file
1758 names will be converted to have initial upper case and otherwise lower
1759 case.
1760
1761 You can also use '\' as a quote character. For example, '\\' is a back‐
1762 slash and '\*' is an asterisk.
1763
1765 The internal file viewer provides two display modes: ASCII and hex. To
1766 toggle between modes, use the F4 key.
1767
1768 The viewer will try to use the best method provided by your system or
1769 the file type to display the information. Some character sequences,
1770 which appear most often in preformatted manual pages, are displayed
1771 bold and underlined, thus making a pretty display of your files.
1772
1773 When in hex mode, the search function accepts text in quotes and con‐
1774 stant numbers. Text in quotes is matched exactly after removing the
1775 quotes. Each number matches one byte. You can mix quoted text with
1776 constants like this:
1777
1778 "String" -1 0xBB 012 "more text"
1779
1780 Note that 012 is an octal number. -1 is converted to 0xFF.
1781
1782 Here is a listing of the actions associated with each key that the Mid‐
1783 night Commander handles in the internal file viewer.
1784
1785 F1 Invoke the built-in hypertext help viewer.
1786
1787 F2 Toggle the wrap mode.
1788
1789 F4 Toggle the hex mode.
1790
1791 F5 Goto line. This will prompt you for a line number and will display
1792 that line.
1793
1794 F6, /. Regular expression search.
1795
1796 ?, Reverse regular expression search.
1797
1798 F7 Normal search / hex mode search.
1799
1800 C-s, F17, n. Start normal search if there was no previous search
1801 expression else find next match.
1802
1803 C-r. Start reverse search if there was no previous search expression
1804 else find next match.
1805
1806 F8 Toggle Raw/Parsed mode: This will show the file as found on disk or
1807 if a processing filter has been specified in the mc.ext file, then the
1808 output from the filter. Current mode is always the other than written
1809 on the button label, since on the button is the mode which you enter by
1810 that key.
1811
1812 F9 Toggle the format/unformat mode: when format mode is on the viewer
1813 will interpret some string sequences to show bold and underline with
1814 different colors. Also, on button label is the other mode than current.
1815
1816 F10, Esc. Exit the internal file viewer.
1817
1818 next-page, space, C-v. Scroll one page forward.
1819
1820 prev-page, Alt-v, C-b, backspace. Scroll one page backward.
1821
1822 down-key Scroll one line forward.
1823
1824 up-key Scroll one line backward.
1825
1826 C-l Refresh the screen.
1827
1828 C-o Switch to the subshell and show the command screen.
1829
1830 ! Like C-o, but run a new shell if the subshell is not running.
1831
1832 [n] m Set the mark n.
1833
1834 [n] r Jump to the mark n.
1835
1836 C-f Jump to the next file.
1837
1838 C-b Jump to the previous file.
1839
1840 Alt-r Toggle the ruler.
1841
1842 It's possible to instruct the file viewer how to display a file, look
1843 at the Extension File Edit section
1844
1846 The internal file editor is a full-featured full screen editor. It can
1847 edit files up to 64 megabytes. It is possible to edit binary files.
1848 The internal file editor is invoked using F4 if the use_internal_edit
1849 option is set in the initialization file.
1850
1851 The features it presently supports are: block copy, move, delete, cut,
1852 paste; key for key undo; pull-down menus; file insertion; macro com‐
1853 mands; regular expression search and replace (and our own scanf-printf
1854 search and replace); shift-arrow text highlighting (if supported by the
1855 terminal); insert-overwrite toggle; word wrap; autoindent; tunable tab
1856 size; syntax highlighting for various file types; and an option to pipe
1857 text blocks through shell commands like indent and ispell.
1858
1859 The editor is very easy to use and requires no tutoring. To see what
1860 keys do what, just consult the appropriate pull-down menu. Other keys
1861 are: Shift movement keys do text highlighting. Ctrl-Ins copies to the
1862 file cooledit.clip and Shift-Ins pastes from cooledit.clip. Shift-Del
1863 cuts to cooledit.clip, and Ctrl-Del deletes highlighted text. Mouse
1864 highlighting also works, and you can override the mouse as usual by
1865 holding down the shift key while dragging the mouse to let normal ter‐
1866 minal mouse highlighting work.
1867
1868 To define a macro, press Ctrl-R and then type out the key strokes you
1869 want to be executed. Press Ctrl-R again when finished. You can then
1870 assign the macro to any key you like by pressing that key. The macro is
1871 executed when you press Ctrl-A and then the assigned key. The macro is
1872 also executed if you press Meta, Ctrl, or Esc and the assigned key,
1873 provided that the key is not used for any other function. Once defined,
1874 the macro commands go into the file .mc/cedit/cooledit.macros in your
1875 home directory. You can delete a macro by deleting the appropriate line
1876 in this file.
1877
1878 F19 will format the currently highlighted block (plain text or C or C++
1879 code or another). This is controlled by the file
1880 /usr/share/mc/edit.indent.rc which is copied to
1881 .mc/cedit/edit.indent.rc in your home directory the first time you use
1882 it.
1883
1884 You can use scanf search and replace to search and replace a C format
1885 string. First take a look at the sscanf and sprintf man pages to see
1886 what a format string is and how it works. Consider following example.
1887 Suppose you want to replace all occurrences of an open bracket, three
1888 comma separated numbers, and a close bracket, with the word apples, the
1889 third number, the word oranges and then the second number. Then fill
1890 in the Replace dialog box as follows:
1891
1892 Enter search string:
1893 (%d,%d,%d)
1894 Enter replacement string:
1895 apples %d oranges %d
1896 Enter replacement argument order:
1897 3,2
1898
1899 The last line specifies that the third and then the second number are
1900 to be used in place of the first and second.
1901
1902 It is advisable to use this feature with Prompt on replace on, because
1903 a match is thought to be found whenever the number of arguments found
1904 matches the number given, which is not always a real match. Scanf also
1905 treats whitespace as being elastic. Note that the scanf format %[ is
1906 very useful for scanning strings, and whitespace.
1907
1908 The editor also displays non-us characters (160+). When editing binary
1909 files, you should set display bits to 7 bits in the options menu to
1910 keep the spacing clean.
1911
1913 Let the Midnight Commander type for you.
1914
1915 Attempt to perform completion on the text before current position. MC
1916 attempts completion treating the text as variable (if the text begins
1917 with $), username (if the text begins with ~), hostname (if the text
1918 begins with @) or command (if you are on the command line in the posi‐
1919 tion where you might type a command, possible completions then include
1920 shell reserved words and shell built-in commands as well) in turn. If
1921 none of these matches, filename completion is attempted.
1922
1923 Filename, username, variable and hostname completion works on all input
1924 lines, command completion is command line specific. If the completion
1925 is ambiguous (there are more different possibilities), MC beeps and the
1926 following action depends on the setting of the Complete: show all
1927 option in the Configuration dialog. If it is enabled, a list of all
1928 possibilities pops up next to the current position and you can select
1929 with the arrow keys and Enter the correct entry. You can also type the
1930 first letters in which the possibilities differ to move to a subset of
1931 all possibilities and complete as much as possible. If you press Alt-
1932 Tab again, only the subset will be shown in the listbox, otherwise the
1933 first item which matches all the previous characters will be high‐
1934 lighted. As soon as there is no ambiguity, dialog disappears, but you
1935 can hide it by canceling keys Esc, F10 and left and right arrow keys.
1936 If Complete: show all is disabled, the dialog pops up only if you press
1937 Alt-Tab for the second time, for the first time MC just beeps.
1938
1940 The Midnight Commander is provided with a code layer to access the file
1941 system; this code layer is known as the virtual file system switch.
1942 The virtual file system switch allows the Midnight Commander to manipu‐
1943 late files not located on the Unix file system.
1944
1945 Currently the Midnight Commander is packaged with some Virtual File
1946 Systems (VFS): the local file system, used for accessing the regular
1947 Unix file system; the ftpfs, used to manipulate files on remote systems
1948 with the FTP protocol; the tarfs, used to manipulate tar and compressed
1949 tar files; the undelfs, used to recover deleted files on ext2 file sys‐
1950 tems (the default file system for Linux systems), fish (for manipulat‐
1951 ing files over shell connections such as rsh and ssh) and finally the
1952 mcfs (Midnight Commander file system), a network based file system. If
1953 the code was compiled with smbfs support, you can manipulate files on
1954 remote systems with the SMB (CIFS) protocol.
1955
1956 A generic extfs (EXTernal virtual File System) is provided in order to
1957 easily expand VFS capabilities using scripts and external software.
1958
1959 The VFS switch code will interpret all of the path names used and will
1960 forward them to the correct file system, the formats used for each one
1961 of the file systems is described later in their own section.
1962
1963 FTP File System
1964 The FTP File System (ftpfs) allows you to manipulate files on remote
1965 machines. To actually use it, you can use the FTP link item in the
1966 menu or directly change your current directory using the cd command to
1967 a path name that looks like this:
1968
1969 /#ftp:[!][user[:pass]@]machine[:port][remote-dir]
1970
1971 The user, port and remote-dir elements are optional. If you specify
1972 the user element, the Midnight Commander will login to the remote
1973 machine as that user, otherwise it will use anonymous login or the
1974 login name from the ~/.netrc file. The optional pass element is the
1975 password used for the connection. Using the password in the VFS direc‐
1976 tory name is not recommended, because it can appear on the screen in
1977 clear text and can be saved to the directory history.
1978
1979 To enable using FTP proxy, prepend ! (an exclamation sign) to the
1980 hostname.
1981
1982 Examples:
1983
1984 /#ftp:ftp.nuclecu.unam.mx/linux/local
1985 /#ftp:tsx-11.mit.edu/pub/linux/packages
1986 /#ftp:!behind.firewall.edu/pub
1987 /#ftp:guest@remote-host.com:40/pub
1988 /#ftp:miguel:xxx@server/pub
1989
1990 Please check the Virtual File System dialog box for ftpfs options.
1991
1992 Tar File System
1993 The tar file system provides you with read-only access to your tar
1994 files and compressed tar files by using the chdir command. To change
1995 your directory to a tar file, you change your current directory to the
1996 tar file by using the following syntax:
1997
1998 /filename.tar#utar/[dir-inside-tar]
1999
2000 The mc.ext file already provides a shortcut for tar files, this means
2001 that usually you just point to a tar file and press return to enter
2002 into the tar file, see the Extension File Edit section for details on
2003 how this is done.
2004
2005 Examples:
2006
2007 mc-3.0.tar.gz#utar/mc-3.0/vfs
2008 /ftp/GCC/gcc-2.7.0.tar#utar
2009
2010 The latter specifies the full path of the tar archive.
2011
2012 FIle transfer over SHell filesystem
2013 The fish file system is a network based file system that allows you to
2014 manipulate the files in a remote machine as if they were local. To use
2015 this, the other side has to either run fish server, or has to have
2016 bash-compatible shell.
2017
2018 To connect to a remote machine, you just need to chdir into a special
2019 directory which name is in the following format:
2020
2021 /#sh:[user@]machine[:options]/[remote-dir]
2022
2023 The user, options and remote-dir elements are optional. If you specify
2024 the user element, the Midnight Commander will try to login on the
2025 remote machine as that user, otherwise it will use your login name.
2026
2027 The options are 'C' - use compression and 'rsh' use rsh instead of ssh.
2028 If the remote-dir element is present, your current directory on the
2029 remote machine will be set to this one.
2030
2031 Examples:
2032
2033 /#sh:onlyrsh.mx:r/linux/local
2034 /#sh:joe@want.compression.edu:C/private
2035 /#sh:joe@noncompressed.ssh.edu/private
2036
2037 Network File System
2038 The Midnight Commander file system is a network base file system that
2039 allows you to manipulate the files in a remote machine as if they were
2040 local. To use this, the remote machine must be running the mcserv(8)
2041 server program.
2042
2043 To connect to a remote machine, you just need to chdir into a special
2044 directory which name is in the following format:
2045
2046 /#mc:[user@]machine[:port][remote-dir]
2047
2048 The user, port and remote-dir elements are optional. If you specify
2049 the user element then the Midnight Commander will try to logon on the
2050 remote machine as that user, otherwise it will use your login name.
2051
2052 The port element is used when the remote server is running on a special
2053 port (see the mcserv(8) manual page for more information about ports);
2054 finally, if the remote-dir element is present, your current directory
2055 on the remote machine will be set to this one.
2056
2057 Examples:
2058
2059 /#mc:ftp.nuclecu.unam.mx/linux/local
2060 /#mc:joe@foo.edu:11321/private
2061
2062 Undelete File System
2063 On Linux systems, if you asked configure to use the ext2fs undelete
2064 facilities, you will have the undelete file system available. Recovery
2065 of deleted files is only available on ext2 file systems. The undelete
2066 file system is just an interface to the ext2fs library to retrieve all
2067 of the deleted files names on an ext2fs and provides and to extract the
2068 selected files into a regular partition.
2069
2070 To use this file system, you have to chdir into the special file name
2071 formed by the "/#undel" prefix and the file name where the actual file
2072 system resides.
2073
2074 For example, to recover deleted files on the second partition of the
2075 first SCSI disk on Linux, you would use the following path name:
2076
2077 /#undel:sda2
2078
2079 It may take a while for the undelfs to load the required information
2080 before you start browsing files there.
2081
2082 SMB File System
2083 The smbfs allows you to manipulate files on remote machines with SMB
2084 (or CIFS) protocol. These include Windows for Workgroups, Windows
2085 9x/ME/XP, Windows NT, Windows 2000 and Samba. To actually use it, you
2086 may try to use the panel command "SMB link..." (accessible from the
2087 menubar) or you may directly change your current directory to it using
2088 the cd command to a path name that looks like this:
2089
2090 /#smb:[user@]machine[/service][/remote-dir]
2091
2092 The user, service and remote-dir elements are optional. The user,
2093 domain and password can be specified in an input dialog.
2094
2095 Examples:
2096
2097 /#smb:machine/Share
2098 /#smb:other_machine
2099 /#smb:guest@machine/Public/Irlex
2100
2101 EXTernal File System
2102 extfs allows to integrate numerous features and file types into GNU
2103 Midnight Commander in an easy way, by writing scripts.
2104
2105 Extfs filesystems can be divided into two categories:
2106
2107 1. Stand-alone filesystems, which are not associated with any existing
2108 file. They represent certain system-wide data as a directory tree.
2109 You can invoke them by typing 'cd #fsname' where fsname is an extfs
2110 short name (see below). Examples of such filesystems include audio
2111 (list audio tracks on the CD) or apt (list of all Debian packages in
2112 the system).
2113
2114 For example, to list CD-Audio tracks on your CD-ROM drive, type
2115
2116 cd #audio
2117
2118 2. 'Archive' filesystems (like rpm, patchfs and more), which represent
2119 contents of a file as a directory tree. It can consist of 'real' files
2120 compressed in an archive (urar, rpm) or virtual files, like messages in
2121 a mailbox (mailfs) or parts of a patch (patchfs). To access such
2122 filesystems '#fsname' should be appended to the archive name. Note
2123 that the archive itself can be on another vfs.
2124
2125 For example, to list contents of a zip archive documents.zip type
2126
2127 cd documents.zip#uzip
2128
2129 In many aspects, you could treat extfs like any other directory. For
2130 instance, you can add it to the hotlist or change to it from directory
2131 history. An important limitation is that you cannot invoke shell com‐
2132 mands inside extfs, just like any other non-local VFS.
2133
2134 Common extfs scripts included with Midnight Commander are:
2135
2136 a access 'A:' DOS/Windows diskette (cd #a).
2137
2138 apt front end to Debian's APT package management system (cd #apt).
2139
2140 audio audio CD ripping and playing (cd #audio or cd device#audio).
2141
2142 bpp package of Bad Penguin GNU/Linux distribution (cd file.bpp#bpp).
2143
2144 deb package of Debian GNU/Linux distribution (cd file.deb#deb).
2145
2146 dpkg Debian GNU/Linux installed packages (cd #deb).
2147
2148 hp48 view and copy files to/from a HP48 calculator (cd #hp48).
2149
2150 lslR browsing of lslR listings as found on many FTPs (cd file‐
2151 name#lslR).
2152
2153 mailfs mbox-style mailbox files support (cd mailbox#mailfs).
2154
2155 patchfs
2156 extfs to handle unified and context diffs (cd filename#patchfs).
2157
2158 rpm RPM package (cd filename#rpm).
2159
2160 rpms RPM database management (cd #rpms).
2161
2162 ulha, urar, uzip, uzoo, uar, uha
2163 archivers (cd archive#xxxx where xxxx is one of: ulha, urar,
2164 uzip, uzoo, uar, uha).
2165
2166 You could bind file type/extension to specified extfs as described in
2167 the Extension File Edit section. Here is an example entry for Debian
2168 packages:
2169
2170 regex/.deb$
2171 Open=%cd %p#deb
2172
2174 The Midnight Commander will try to detect if your terminal supports
2175 color using the terminal database and your terminal name. Sometimes it
2176 gets confused, so you may force color mode or disable color mode using
2177 the -c and -b flag respectively.
2178
2179 If the program is compiled with the Slang screen manager instead of
2180 ncurses, it will also check the variable COLORTERM, if it is set, it
2181 has the same effect as the -c flag.
2182
2183 You may specify terminals that always force color mode by adding the
2184 color_terminals variable to the Colors section of the initialization
2185 file. This will prevent the Midnight Commander from trying to detect
2186 if your terminal supports color. Example:
2187
2188 [Colors]
2189 color_terminals=linux,xterm
2190 color_terminals=terminal-name1,terminal-name2...
2191
2192 The program can be compiled with both ncurses and slang, ncurses does
2193 not provide a way to force color mode: ncurses uses just the informa‐
2194 tion in the terminal database.
2195
2196 The Midnight Commander provides a way to change the default colors.
2197 Currently the colors are configured using the environment variable
2198 MC_COLOR_TABLE or the Colors section in the initialization file.
2199
2200 In the Colors section, the default color map is loaded from the
2201 base_color variable. You can specify an alternate color map for a ter‐
2202 minal by using the terminal name as the key in this section. Example:
2203
2204 [Colors]
2205 base_color=
2206 xterm=menu=magenta:marked=,magenta:markselect=,red
2207
2208 The format for the color definition is:
2209
2210 <keyword>=<foregroundcolor>,<backgroundcolor>:<keyword>= ...
2211
2212 The colors are optional, and the keywords are: normal, selected,
2213 marked, markselect, errors, input, reverse, gauge. Menu colors are:
2214 menu, menusel, menuhot, menuhotsel. Dialog colors are: dnormal, dfo‐
2215 cus, dhotnormal, dhotfocus. Help colors are: helpnormal, helpitalic,
2216 helpbold, helplink, helpslink. Viewer color is: viewunderline. Spe‐
2217 cial highlighting colors are: executable, directory, link, stalelink,
2218 device, special, core. Editor colors are: editnormal, editbold, edit‐
2219 marked.
2220
2221 input determines the color of input lines used in query dialogs.
2222
2223 gauge determines the color of the filled part of the progress bar
2224 (gauge), which is used to show the user the progress of file opera‐
2225 tions, such as copying.
2226
2227 The dialog boxes use the following colors: dnormal is used for the nor‐
2228 mal text, dfocus is the color used for the currently selected compo‐
2229 nent, dhotnormal is the color used to differentiate the hotkey color in
2230 normal components, whereas the dhotfocus color is used for the high‐
2231 lighted color in the currently selected component.
2232
2233 Menus use the same scheme but uses the menu, menusel, menuhot and
2234 menuhotsel tags instead.
2235
2236 Help uses the following colors: helpnormal is used for normal text,
2237 helpitalic is used for text which is emphasized in italic in the manual
2238 page, helpbold is used for text which is emphasized in bold in the man‐
2239 ual page, helplink is used for not selected hyperlinks and helpslink is
2240 used for selected hyperlink.
2241
2242 Special highlight colors determine how files are displayed when file
2243 highlighting is enabled (see the section on Layout). directory is used
2244 for directories or symbolic links to directories; executable for exe‐
2245 cutable files; link is used for symbolic links which are neither stale
2246 nor linked to a directory; stalelink is used for stale symbolic links;
2247 device - character and block devices; special is used for special
2248 files, such as pipes and sockets; core is for core files.
2249
2250 The possible colors are: black, gray, red, brightred, green, bright‐
2251 green, brown, yellow, blue, brightblue, magenta, brightmagenta, cyan,
2252 brightcyan, lightgray and white. And there is a special keyword for
2253 transparent background. It is 'default'. The 'default' can only be used
2254 for background color. Example:
2255
2256 [Colors]
2257 base_color=normal=white,default:marked=magenta,default
2258
2260 Most of the settings of the Midnight Commander can be changed from the
2261 menus. However, there are a small number of settings which can only be
2262 changed by editing the setup file.
2263
2264 These variables may be set in your ~/.mc/ini file:
2265
2266 clear_before_exec
2267 By default the Midnight Commander clears the screen before exe‐
2268 cuting a command. If you would prefer to see the output of the
2269 command at the bottom of the screen, edit your ~/.mc/ini file
2270 and change the value of the field clear_before_exec to 0.
2271
2272 confirm_view_dir
2273 If you press F3 on a directory, normally MC enters that direc‐
2274 tory. If this flag is set to 1, then MC will ask for confirma‐
2275 tion before changing the directory if you have files tagged.
2276
2277 ftpfs_retry_seconds
2278 This value is the number of seconds the Midnight Commander will
2279 wait before attempting to reconnect to an FTP server that has
2280 denied the login. If the value is zero, the login will no be
2281 retried.
2282
2283 max_dirt_limit
2284 Specifies how many screen updates can be skipped at most in the
2285 internal file viewer. Normally this value is not significant,
2286 because the code automatically adjusts the number of updates to
2287 skip according to the rate of incoming keystrokes. However, on
2288 very slow machines or terminals with a fast keyboard auto
2289 repeat, a big value can make screen updates too jumpy.
2290
2291 It seems that setting max_dirt_limit to 10 causes the best
2292 behavior, and that is the default value.
2293
2294 mouse_move_pages
2295 Controls whenever scrolling with the mouse is done by pages or
2296 line by line on the panels.
2297
2298 mouse_move_pages_viewer
2299 Controls if scrolling with the mouse is done by pages or line by
2300 line on the internal file viewer.
2301
2302 old_esc_mode
2303 By default the Midnight Commander treats the ESC key as a key
2304 prefix (old_esc_mode=0). If this option is set
2305 (old_esc_mode=1), the ESC key will act as a prefix key for one
2306 second, and if no extra keys have arrived, then the ESC key is
2307 interpreted as a cancel key (ESC ESC).
2308
2309 only_leading_plus_minus
2310 Allow special treatment for '+', '-', '*' in the command line
2311 (select, unselect, reverse selection) only if the command line
2312 is empty. You don't need to quote those characters in the mid‐
2313 dle of the command line. On the other hand, you cannot use them
2314 to change selection when the command line is not empty.
2315
2316 panel_scroll_pages
2317 If set (the default), panel will scroll by half the display when
2318 the cursor reaches the end or the beginning of the panel, other‐
2319 wise it will just scroll a file at a time.
2320
2321 show_output_starts_shell
2322 This variable only works if you are not using the subshell sup‐
2323 port. When you use the C-o keystroke to go back to the user
2324 screen, if this one is set, you will get a fresh shell. Other‐
2325 wise, pressing any key will bring you back to the Midnight Com‐
2326 mander.
2327
2328 torben_fj_mode
2329 If this flag is set, then the home and end keys will work
2330 slightly different on the panels, instead of moving the selec‐
2331 tion to the first and last files in the panels, they will act as
2332 follows:
2333
2334 The home key will: Go up to the middle line, if below it; else
2335 go to the top line unless it is already on the top line, in this
2336 case it will go to the first file in the panel.
2337
2338 The end key has a similar behavior: Go down to the middle line,
2339 if over it; else go to the bottom line unless you already are at
2340 the bottom line, in such case it will move the selection to the
2341 last file name in the panel.
2342
2343 use_file_to_guess_type
2344 If this variable is on (the default) it will spawn the file com‐
2345 mand to match the file types listed on the mc.ext file.
2346
2347 xterm_mode
2348 If this variable is on (default is off) when you browse the file
2349 system on a Tree panel, it will automatically reload the other
2350 panel with the contents of the selected directory.
2351
2352 fish_directory_timeout
2353 This variable holds the lifetime of a directory cache entry in
2354 seconds. The default value is 900 seconds.
2355
2357 The Midnight Commander provides a way to fix your system terminal data‐
2358 base without requiring root privileges. The Midnight Commander
2359 searches in the system initialization file (the mc.lib file located in
2360 the Midnight Commander library directory) and in the ~/.mc/ini file for
2361 the section "terminal:your-terminal-name" and then for the section
2362 "terminal:general", each line of the section contains a key symbol that
2363 you want to define, followed by an equal sign and the definition for
2364 the key. You can use the special \e form to represent the escape char‐
2365 acter and the ^x to represent the control-x character.
2366
2367 The possible key symbols are:
2368
2369 f0 to f20 Function keys f0-f20
2370 bs backspace
2371 home home key
2372 end end key
2373 up up arrow key
2374 down down arrow key
2375 left left arrow key
2376 right right arrow key
2377 pgdn page down key
2378 pgup page up key
2379 insert the insert character
2380 delete the delete character
2381 complete to do completion
2382
2383 For example, to define the key insert to be the Escape + [ + O + p, you
2384 set this in the ini file:
2385
2386 insert=\e[Op
2387
2388 The complete key symbol represents the escape sequences used to invoke
2389 the completion process, this is invoked with Alt-tab, but you can
2390 define other keys to do the same work (on those keyboard with tons of
2391 nice and unused keys everywhere).
2392
2393
2395 Full paths below may vary between installations. They are also
2396 affected by the MC_DATADIR environment variable. If it's set, its
2397 value is used instead of /usr/share/mc in the paths below.
2398
2399 /usr/share/mc/mc.hlp
2400
2401 The help file for the program.
2402
2403 /usr/share/mc/mc.ext
2404
2405 The default system-wide extensions file.
2406
2407 ~/.mc/bindings
2408
2409 User's own extension, view configuration and edit configuration
2410 file. They override the contents of the system wide files if
2411 present.
2412
2413 /usr/share/mc/mc.ini
2414
2415 The default system-wide setup for the Midnight Commander, used
2416 only if the user doesn't have his own ~/.mc/ini file.
2417
2418 /usr/share/mc/mc.lib
2419
2420 Global settings for the Midnight Commander. Settings in this
2421 file affect all users, whether they have ~/.mc/ini or not. Cur‐
2422 rently, only terminal settings are loaded from mc.lib.
2423
2424 ~/.mc/ini
2425
2426 User's own setup. If this file is present then the setup is
2427 loaded from here instead of the system-wide startup file.
2428
2429 /usr/share/mc/mc.hint
2430
2431 This file contains the hints displayed by the program.
2432
2433 /usr/share/mc/mc.menu
2434
2435 This file contains the default system-wide applications menu.
2436
2437 ~/.mc/menu
2438
2439 User's own application menu. If this file is present it is used
2440 instead of the system-wide applications menu.
2441
2442 ~/.mc/Tree
2443
2444 The directory list for the directory tree and tree view fea‐
2445 tures.
2446
2447 ./.mc.menu
2448
2449 Local user-defined menu. If this file is present, it is used
2450 instead of the home or system-wide applications menu.
2451
2453 This program is distributed under the terms of the GNU General Public
2454 License as published by the Free Software Foundation. See the built-in
2455 help for details on the License and the lack of warranty.
2456
2458 The latest version of this program can be found at ftp://ftp.ibib‐
2459 lio.org/pub/Linux/utils/file/managers/mc/.
2460
2462 ed(1), gpm(1), mcserv(8), terminfo(1), view(1), sh(1), bash(1),
2463 tcsh(1), zsh(1).
2464
2465 The Midnight Commander page on the World Wide Web:
2466 http://www.ibiblio.org/mc/
2467
2469 Authors and contributors are listed in the AUTHORS file in the source
2470 distribution.
2471
2473 See the file TODO in the distribution for information on what remains
2474 to be done.
2475
2476 If you want to report a problem with the program, please send mail to
2477 this address: mc-devel@gnome.org.
2478
2479 Provide a detailed description of the bug, the version of the program
2480 you are running (mc -V displays this information), the operating system
2481 you are running the program on. If the program crashes, we would
2482 appreciate a stack trace.
2483
2484
2485
2486MC Version 4.6.0 January 2003 MC(1)