.TH mc 1 "30 October 1998" .\"SKIP_SECTION" .SH NAME mc \- Visual shell for Unix-like systems. .\"SKIP_SECTION" .SH USAGE .B mc [\-abcCdfhPstuUVx?] [\-l log] [dir1 [dir2]] [-v file] .SH DESCRIPTION .LP The Midnight Commander is a directory browser/file manager for Unix-like operating systems. .\".\"DONT_SPLIT" .SH OPTIONS .TP .I "\-a" Disables the usage of graphic characters for line drawing. .TP .I "\-b" Forces black and white display. .TP .I "\-c" Force color mode, please check the section .\"LINK2" Colors .\"Colors" for more information. .TP .I "\-C arg" Used to specify a different color set in the command line. The format of arg is documented in the .\"LINK2" Colors .\"Colors" section. .TP .I "\-d" Disables mouse support. .TP .I "\-f" Displays the compiled-in search paths for Midnight Commander files. .TP .I "\-k" Reset softkeys to their default from the termcap/terminfo database. Only useful on HP terminals when the function keys don't work. .TP .I "-l file" Save the ftpfs dialog with the server in file. .TP .I "\-P" At program end, the Midnight Commander will print the last working directory; this, along with the shell function below, will allow you to browse through your directories and automatically move to the last directory you were in (thanks to Torben Fjerdingstad and Sergey for contributing this function and the code which implements this option). .nf bash and zsh users: mc () { MC=/tmp/mc$$-"$RANDOM" @prefix@/bin/mc -P "$@" > "$MC" cd "`cat $MC`" rm "$MC" unset MC; } tcsh users: alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC' .fi .TP I know the bash function could be shorter for zsh and bash but the backquotes on bash won't accept your suspension the program with C-z. .TP .I "\-s" Turns on the slow terminal mode, in this mode the program will not draw expensive line drawing characters and will toggle verbose mode off. .TP .I "\-t" Used only if the code was compiled with Slang and terminfo: it makes the Midnight Commander use the value of the .B TERMCAP variable for the terminal information instead of the information on the system wide terminal database .TP .I "\-u" Disables the use of a concurrent shell (only makes sense if the Midnight Commander has been built with concurrent shell support). .TP .I "\-U" Enables the use of the concurrent shell support (only makes sense if the Midnight Commander was built with the subshell support set as an optional feature). .TP .I "\-v file" Enters the internal viewer to view the file specified. .TP .I "\-V" Displays the version of the program. .TP .I "\-x" Forces xterm mode. Used when running on xterm-capable terminals (two screen modes, and able to send mouse escape sequences). .PP If specified, the first path name is the directory to show in the selected panel; the second path name is the directory to be shown in the other panel. .PP .SH "Overview" The screen of the Midnight Commander is divided into four parts. Almost all of the screen space is taken up by two directory panels. By default, the second bottommost line of the screen is the shell command line, and the bottom line shows the function key labels. The topmost line is the .\"LINK2" menu bar line. .\"Menu Bar" The menu bar line may not be visible, but appears if you click the topmost line with the mouse or press the F9 key. .PP The Midnight Commander provides a view of two directories at the same time. One of the panels is the current panel (a selection bar is in the current panel). Almost all operations take place on the current panel. Some file operations like Rename and Copy by default use the directory of the unselected panel as a destination (don't worry, they always ask you for confirmation first). For more information, see the sections on the .\"LINK2" Directory Panels, .\"Directory Panels" the .\"LINK2" Left and Right Menus .\"Left and Right Menus" and the .\"LINK2" File Menu. .\"File Menu" .PP You can execute system commands from the Midnight Commander by simply typing them. Everything you type will appear on the shell command line, and when you press Enter the Midnight Commander will execute the command line you typed; read the .\"LINK2" Shell Command Line .\"Shell Command Line" and .\"LINK2" Input Line Keys .\"Input Line Keys" sections to learn more about the command line. .PP .SH "Mouse Support" The Midnight Commander comes with mouse support. It is activated whenever you are running on an .B xterm(1) terminal (it even works if you take a telnet or rlogin connection to another machine from the xterm) or if you are running on a Linux console and have the .B gpm mouse server running. .PP When you left click on a file in the directory panels, that file is selected; if you click with the right button, the file is marked (or unmarked, depending on the previous state). .PP Double-clicking on a file will try to execute the command if it is an executable program; and if the .\"LINK2" extension file .\"Extension File Edit" has a program specified for the file's extension, the specified program is executed. .PP Also, it is possible to execute the commands assigned to the function key labels by clicking on them. .PP If a mouse button is clicked on the top frame line of the directory panel, it is scrolled one pageful backward. Correspondingly, a click on the bottom frame line will cause a scroll of one pageful forward. This frame line method works also in the .\"LINK2" Help Viewer .\"Help" and the .\"LINK2" Directory Tree. ."Directory Tree" .PP The default auto repeat rate for the mouse buttons is 400 milliseconds. This may be changed to other values by editing the .\"LINK2" \&~/.mc/ini .\"Save Setup" file and changing the .I mouse_repeat_rate parameter. .PP If you are running the Commander with the mouse support, you can bypass the Commander and get the default mouse behavior (cutting and pasting text) by holding down the Shift key. .SH "" .SH "Keys" Some commands in the Midnight Commander involve the use of the .I Control (sometimes labeled CTRL or CTL) and the .I Meta (sometimes labeled ALT or even Compose) keys. In this manual we will use the following abbreviations: .PP C- means hold the Control key while typing the character . Thus C-f would be: hold the Control key and type f. .PP M- means hold the Meta or Alt key down while typing . If there is no Meta or Alt key, type ESC, release it, then type the character . .PP All input lines in the Midnight Commander use an approximation to the GNU Emacs editor's key bindings. .PP There are many sections which tell about the keys. The following are the most important. .PP The .\"LINK2" File Menu .\"File Menu" section documents the keyboard shortcuts for the commands appearing in the File menu. This section includes the function keys. Most of these commands perform some action, usually on the selected file or the tagged files. .PP The .\"LINK2" Directory Panels .\"Directory Panels" section documents the keys which select a file or tag files as a target for a later action (the action is usually one from the file menu). .PP The .\"LINK2" Shell Command Line .\"Shell Command Line" section list the keys which are used for entering and editing command lines. Most of these copy file names and such from the directory panels to the command line (to avoid excessive typing) or access the command line history. .PP .\"LINK2" Input Line Keys .\"Input Line Keys" are used for editing input lines. This means both the command line and the input lines in the query dialogs. .PP .SH " Miscellaneous Keys" Here are some keys which don't fall into any of the other categories: .PP .B Enter. If there is some text in the command line (the one at the bottom of the panels), then that command is executed. If there is no text in the command line then if the selection bar is over a directory the Midnight Commander does a .B chdir(2) to the selected directory and reloads the information on the panel; if the selection is an executable file then it is executed. Finally, if the extension of the selected file name matches one of the extensions in the .\"LINK2" extensions file .\"Extension File Edit" then the corresponding command is executed. .PP .B C-l. Repaint all the information in the Midnight Commander. .PP .B C-x c. Run the .\"LINK2" Chmod .\"Chmod" command on a file or on the tagged files. .PP .B C-x o. Run the .\"LINK2" Chown .\"Chown" command on the current file or on the tagged files. .PP .B C-x l. Run the link command. .PP .B C-x s. Run the symbolic link command. .PP .B C-x i. Set the other panel display mode to information. .PP .B C-x q. Set the other panel display mode to quick view. .PP .B C-x !. Execute the .\"LINK2" External panelize .\"External panelize" command. .PP .B C-x h Run the .\"LINK2" add directory to hotlist .\"Hotlist" command. .PP .B M-!, Executes the Filtered view command, described in the .\"LINK2" view command. .\"Internal File Viewer" .PP .B M-?, Executes the .\"LINK2" Find file .\"Find File" command. .PP .B M-c, Pops up the .\"LINK2" quick cd .\"Quick cd" dialog. .PP .B C-o, When the program is being run in the Linux or SCO console or under an xterm, it will show you the output of the previous command. When ran on the Linux console, the Midnight Commander uses an external program (cons.saver) to handle saving and restoring of information on the screen. .PP When the subshell support is compiled in, you can type C-o at any time and you will be taken back to the Midnight Commander main screen, to return to your application just type C-o. If you have an application suspended by using this trick, you won't be able to execute other programs from the Midnight Commander until you terminate the suspended application. .PP .SH " Directory Panels" This section lists the keys which operate on the directory panels. If you want to know how to change the appearance of the panels take a look at the section on .\"LINK2" Left and Right Menus. .\"Left and Right Menus" .PP .B Tab, C-i. Change the current panel. The old other panel becomes the new current panel and the old current panel becomes the new other panel. The selection bar moves from the old current panel to the new current panel. .PP .B Insert, C-t. To tag files you may use the Insert key (the kich1 terminfo sequence) or the C-t (Control-t) sequence. To untag files, just retag a tagged file. .PP .B M-g, M-h (or M-r), M-j. Used to select the top file in a panel, the middle file and the bottom one, respectively. .PP .B C-s, M-s. Start a filename search in the directory listing. When the search is active the keypresses will be added to the search string instead of the command line. If the .I "Show mini-status" option is enabled the search string is shown on the mini-status line. When typing, the selection bar will move to the next file starting with the typed letters. The .I "backspace" or DEL keys can be used to correct typing mistakes. If C-s is pressed again, the next match is searched for. .PP .B M-t Toggle the current display listing to show the next display listing mode. With this it is possible to quickly switch from long listing to regular listing and the user defined listing mode. .PP .B C-\\\\ (control-backslash). Show the .\"LINK2" directory hotlist .\"Hotlist" and change to the selected directory. .PP .B + \ (plus). This is used to select (tag) a group of files. The Midnight Commander will prompt for a regular expression describing the group. When .I Shell Patterns are enabled, the regular expression is much like the regular expressions in the shell (* standing for zero or more characters and ? standing for one character). If .I Shell Patterns is off, then the tagging of files is done with normal regular expressions (see ed (1)). .PP If the expression starts or ends with a slash (/), then it will select directories instead of files. .PP .B \\\\ (backslash). Use the "\\" key to unselect a group of files. This is the opposite of the Plus key. .PP .B up-key, C-p. Move the selection bar to the previous entry in the panel. .PP .B down-key, C-n. Move the selection bar to the next entry in the panel. .PP .B home, a1, M-<. Move the selection bar to the first entry in the panel. .PP .B end, c1, M->. Move the selection bar to the last entry in the panel. .PP .B next-page, C-v. Move the selection bar one page down. .PP .B prev-page, M-v. Move the selection bar one page up. .PP .B M-o, If the other panel is a listing panel and you are standing on a directory in the current panel, then the other panel contents are set to the contents of the currently selected directory (like Emacs' dired C-o key) otherwise the other panel contents are set to the parent dir of the current dir. .PP .B C-PageUp, C-PageDown Only when ran on the Linux console: does a chdir to ".." and to the currently selected directory respectively. .PP .B M-y Moves to the previous directory in the history, equivalent to depressing the '<' with the mouse. .PP .B M-u Moves to the next directory in the history, equivalent to depressing the '>' with the mouse. .BM-S-h, M-H Displays the directory history, equivalent to depressing the 'v' with the mouse. .PP .SH " Shell Command Line" This section lists keys which are useful to avoid excessive typing when entering shell commands. .PP .B M-Enter. Copy the currently selected file name to the command line. .PP .B C-Enter. Same a M-Enter, this one only works on the Linux console. .PP .B M-Tab. Does the filename, command, variable, username and hostname .\"LINK2" completion .\"Completion" for you. .PP .B C-x t, C-x C-t. Copy the tagged files (or if there are no tagged files, the selected file) of the current panel (C-x t) or of the other panel (C-x C-t) to the command line. .PP .B C-x p, C-x C-p. The first key sequence copies the current path name to the command line, and the second one copies the unselected panel's path name to the command line. .PP .B C-q. The quote command can be used to insert characters that are otherwise interpreted by the Midnight Commander (like the '+' symbol) .PP .B M-p, M-n. Use these keys to browse through the command history. M-p takes you to the last entry, M-n takes you to the next one. .PP .B M-h. Displays the history for the current input line. .PP .SH " General Movement Keys" The help viewer, the file viewer and the directory tree use common code to handle moving. Therefore they accept exactly the same keys. Each of them also accepts some keys of its own. .PP Other parts of the Midnight Commander use some of the same movement keys, so this section may be of use for those parts too. .PP .B Up, C-p. Moves one line backward. .PP .B Down, C-n. Moves one line forward. .PP .B Prev Page, Page Up, M-v. Moves one pageful backward. .PP .B Next Page, Page Down, C-v. Moves one pageful forward. .PP .B Home, A1. Moves to the beginning. .PP .B End, C1. Move to the end. .PP The help viewer and the file viewer accept the following keys in addition the to ones mentioned above: .PP .B b, C-b, C-h, Backspace, Delete. Moves one pageful backward. .PP .B Space bar. Moves one pageful forward. .PP .B u, d. Moves one half of a page backward or forward. .PP .B g, G. Moves to the beginning or to the end. .PP .SH " Input Line Keys" The input lines (they are used for the .\"LINK2" command line .\"Shell Command Line" and for the query dialogs in the program) accept these keys: .PP .B C-a puts the cursor at the beginning of line. .PP .B C-e puts the cursor at the end of the line. .PP .B C-b, move-left move the cursor one position left. .PP .B C-f, move-right move the cursor one position right. .PP .B M-f moves one word forward. .PP .B M-b moves one word backward. .PP .B C-h, backspace delete the previous character. .PP .B C-d, Delete delete the character in the point (over the cursor). .PP .B C-@ sets the mark for cutting. .PP .B C-w copies the text between the cursor and the mark to a kill buffer and removes the text from the input line. .PP .B M-w copies the text between the cursor and the mark to a kill buffer. .PP .B C-y yanks back the contents of the kill buffer. .PP .B C-k kills the text from the cursor to the end of the line. .PP .B M-p, M-n Use these keys to browse through the command history. M-p takes you to the last entry, M-n takes you to the next one. .PP .B M-C-h, M-Backspace delete one word backward. .PP .B M-Tab does the filename, command, variable, username and hostname .\"LINK2" completion .\"Completion" for you. .PP .SH "" .SH "Menu Bar" The menu bar pops up when you press F9 or click the mouse on the top row of the screen. The menu bar has five menus: "Left", "File", "Command", "Options" and "Right". .PP The .\"LINK2" Left and Right Menus .\"Left and Right Menus" allow you to modify the appearance of the left and right directory panels. .PP The .\"LINK2" File Menu .\"File Menu" lists the actions you can perform on the currently selected file or the tagged files. .PP The .\"LINK2" Command Menu .\"Command Menu" lists the actions which are more general and bear no relation to the currently selected file or the tagged files. .PP .SH " Left and Right Menus" The outlook of the directory panels can be changed from the .B "Left" and .B "Right" menus. .PP .SH " Listing Mode..." The listing mode view is used to display a listing of files, there are four different listing modes available: .B Full, .B Brief, .B Long, and .B User. The full directory view shows the file name, the size of the file and the modification time. .PP The brief view shows only the file name and it has two columns (therefore showing twice as many files as other views). The long view is similar to the output of .B "ls -l" command. The long view takes the whole screen width. .PP If you choose the "User" display format, then you have to specify the display format. .PP The user display format must start with a panel size specifier. This may be "half" or "full", and they specify a half screen panel and a full screen panel respectively. .PP After the panel size, you may specify the two columns mode on the panel, this is done by adding the number "2" to the user format string. .PP After this you add the name of the fields with an optional size specifier. This are the available fields you may display: .PP .B name, displays the file name. .PP .B size, displays the file size. .PP .B bsize, is an alternative form of the