man mc Command

Man page for apt-get mc Command

Man Page for mc in Linux

Ubuntu Man Command : man mc

Man Mc  Command

This tutorial shows the man page for man mc in linux.

Open terminal with 'su' access and type the command as shown below:
man mc

Result of the Command Execution shown below:

MC(1)                                                                  GNU Midnight Commander                                                                  MC(1)



NAME
mc Visual shell for Unix like systems.

USAGE
mc [ abcCdfhPstuUVx] [ l log] [dir1 [dir2]] [ e [file]] [ v file]

DESCRIPTION
GNU Midnight Commander is a directory browser/file manager for Unix like operating systems.

OPTIONS
a, stickchars
Disable usage of graphic characters for line drawing.

b, nocolor
Force black and white display.

c, color
Force color mode, please check the section Colors for more information.

C arg, colors=arg
Specify a different color set in the command line. The format of arg is documented in the Colors section.

S arg Specify a name of skin in the command line. Technology of skins is documented in the Skins. section.

d, nomouse
Disable mouse support.

e [file], edit[=file]
Start the internal editor. If the file is specified, open it on startup. See also mcedit (1).

f, datadir
Display the compiled in search paths for Midnight Commander files.

k, resetsoft
Reset softkeys to their default from the termcap/terminfo database. Only useful on HP terminals when the function keys don't work.

K  Ñ " À ª
Specify a name of keymap file in the command line.

l file, ftplog=file
Save the ftpfs dialog with the server in file.

P file, printwd=file
Print the last working directory to the specified file. This option is not meant to be used directly. Instead, it's used from a special shell script
that automatically changes the current directory of the shell to the last directory the Midnight Commander was in. Source the file
/usr/share/mc/bin/mc.sh (bash and zsh users) or /usr/share/mc/bin/mc.csh (tcsh users) respectively to define mc as an alias to the appropriate shell
script.

s Set alternative mode drawing of frameworks. If the section [Lines] is not filled, the symbol for the pseudographics frame is a space, otherwise the
frame characters are taken from follow params.

You can redefine the following variables:

lefttop
left top corner

righttop
right top corner

centertop
center top cross

centerbottom
center bottom cross

leftbottom
left bottom corner

rightbottom
right bottom corner

leftmiddle
left middle cross

rightmiddle
right middle cross

centermiddle
center cross

horiz default horizontal line

vert default vertical line

thinhoriz
thin horizontal line

thinvert
thin vertical line

t, termcap
Used only if the code was compiled with Slang and terminfo: it makes the Midnight Commander use the value of the TERMCAP variable for the terminal
information instead of the information on the system wide terminal database

u, nosubshell
Disable use of the concurrent shell (only makes sense if the Midnight Commander has been built with concurrent shell support).

U, subshell
Enable use of the concurrent shell support (only makes sense if the Midnight Commander was built with the subshell support set as an optional fea Äê
ture).

v file, view=file
Start the internal viewer to view the specified file. See also mcview (1).

V, version
Display the version of the program.

x, xterm
Force xterm mode. Used when running on xterm capable terminals (two screen modes, and able to send mouse escape sequences).

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.

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
line from the bottom of the screen is the shell command line, and the bottom line shows the function key labels. The topmost line is the menu bar line. The
menu bar line may not be visible, but appears if you click the topmost line with the mouse or press the F9 key.

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 Directory Panels, the Left and Right
Menus and the File Menu.

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 Shell Command Line and Input Line Keys sections to learn more about the
command line.

Mouse Support
The Midnight Commander comes with mouse support. It is activated whenever you are running on an xterm(1) terminal (it even works if you take a telnet, ssh
or rlogin connection to another machine from the xterm) or if you are running on a Linux console and have the gpm mouse server running.

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

Double clicking on a file will try to execute the command if it is an executable program; and if the extension file has a program specified for the file's
extension, the specified program is executed.

Also, it is possible to execute the commands assigned to the function key labels by clicking on them.

If a mouse button is clicked on the top frame line of the directory panel, it is scrolled one page up. Likewise, a click on the bottom frame line will cause
scrolling one page down. This frame line method works also in the Help Viewer and the Directory Tree.

The default auto repeat rate for the mouse buttons is 400 milliseconds. This may be changed to other values by editing the ~/.mc/ini file and changing the
mouse_repeat_rate parameter.

If you are running the Midnight Commander with the mouse support, you can get the default mouse behavior (cutting and pasting text) by holding down the Shift
key.


Keys
Some commands in the Midnight Commander involve the use of the Control (sometimes labeled CTRL or CTL) and the Meta (sometimes labeled ALT or even Compose)
keys. In this manual we will use the following abbreviations:

C <chr>
means hold the Control key while typing the character <chr>. Thus C f would be: hold the Control key and type f.

Alt <chr>
means hold the Meta or Alt key down while typing <chr>. If there is no Meta or Alt key, type ESC, release it, then type the character <chr>.

S <chr>
means hold the Shift key down while typing <chr>.

All input lines in the Midnight Commander use an approximation to the GNU Emacs editor's key bindings (default).

You may redefine key bindings. See redefine hotkey bindings

for more info. All other key bindings (described in this manual) relative to default behavior.


There are many sections which tell about the keys. The following are the most important.

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

The 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).

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

Input Line Keys are used for editing input lines. This means both the command line and the input lines in the query dialogs.


Redefine hotkey bindings
Hotkey bindings may be readed from external file (keymap file). A keymap file is searched on the following algorithm (to the first one found):

1) command line option K <keymap> or keymap=<keymap>
2) Environment variable MC_KEYMAP
3) In config file parameter keymap in section [MidhightCommander]
4) File ~/.mc/mc.keymap
5) File /etc/mc/mc.keymap
6) File /usr/share/mc/mc.keymap


Command line option, environment variable and parameter in config file may contain the absolute path to the keymap file (with the extension .keymap or with Äê
out it). Search of keymap file will occur in (to the first one found):

1) ~/.mc/
2) /etc/mc/
3) /usr/share/mc/


Miscellaneous Keys
Here are some keys which don't fall into any of the other categories:

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 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 extensions file then the corresponding command is executed.

C l repaint all the information in the Midnight Commander.

C x c run the Chmod command on a file or on the tagged files.

C x o run the Chown command on the current file or on the tagged files.

C x l run the link command.

C x s run the symbolic link command.

C x i set the other panel display mode to information.

C x q set the other panel display mode to quick view.

C x ! execute the External panelize command.

C x h run the add directory to hotlist command.

Alt ! executes the Filtered view command, described in the view command.

Alt ? executes the Find file command.

Alt c pops up the quick cd dialog.

C o when the program is being run in the Linux or FreeBSD 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.

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.

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 Left and Right Menus.

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.

Insert, C t
to tag files you may use the Insert key (the kich1 terminfo sequence). To untag files, just retag a tagged file.

M e to change charset of panel you may use M e (Alt e). Recoding is made from selected codepage into system codepage. To cancel the recoding you may
select "directory up" (..) in active panel. To cancel the charsets in all directories, select "No translation " in the dialog of encodings.

Alt g, Alt r, Alt j
used to select the top file in a panel, the middle file and the bottom one, respectively.

C s, Alt s
start a filename search in the directory listing. When the search is active, the user input will be added to the search string instead of the command
line. If the 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 backspace or DEL keys can be used to correct typing mistakes. If C s is pressed again, the next match
is searched for.

Alt t toggle the current display listing to show the next display listing mode. With this it is possible to quickly switch to brief listing, long listing,
user defined listing mode, and back to the default.

C \ (control backslash)
show the directory hotlist and change to the selected directory.

+ (plus)
this is used to select (tag) a group of files. The Midnight Commander will prompt for a selection options. When Files only checkbox is on, only files
will be selected. If Files only is off, as files as directories will be selected. When Shell Patterns checkbox is on, the regular expression is much
like the filename globbing in the shell (* standing for zero or more characters and ? standing for one character). If Shell Patterns is off, then the
tagging of files is done with normal regular expressions (see ed (1)). When Case sensitive checkbox is on, the selection will be case sensitive char Äê
acters. If Case sensitive is off, the case will be ignored.

\ (backslash)
use the "\" key to unselect a group of files. This is the opposite of the Plus key.

up key, C p
move the selection bar to the previous entry in the panel.

down key, C n
move the selection bar to the next entry in the panel.

home, a1, Alt <
move the selection bar to the first entry in the panel.

end, c1, Alt >
move the selection bar to the last entry in the panel.

next page, C v
move the selection bar one page down.

prev page, Alt v
move the selection bar one page up.

Alt o If the currently selected file is a directory, load that directory on the other panel and moves the selection to the next file. If the currently
selected file is not a directory, load the parent directory on the other panel and moves the selection to the next file.

Alt i make the current directory of the current panel also the current directory of the other panel. Put the other panel to the listing mode if needed. If
the current panel is panelized, the other panel doesn't become panelized.

C PageUp, C PageDown
only when supported by the terminal: change to ".." and to the currently selected directory respectively.

Alt y moves to the previous directory in the history, equivalent to clicking the < with the mouse.

Alt u moves to the next directory in the history, equivalent to clicking the > with the mouse.

Alt Shift h, Alt H
displays the directory history, equivalent to depressing the 'v' with the mouse.

Shell Command Line
This section lists keys which are useful to avoid excessive typing when entering shell commands.

Alt Enter
copy the currently selected file name to the command line.

C Enter
same a Alt Enter. May not work on remote systems and some terminals.

C Shift Enter
copy the full path name of the currently selected file to the command line. May not work on remote systems and some terminals.

Alt Tab
does the filename, command, variable, username and hostname completion for you.

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.

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.

C q the quote command can be used to insert characters that are otherwise interpreted by the Midnight Commander (like the '+' symbol)

Alt p, Alt n
use these keys to browse through the command history. Alt p takes you to the last entry, Alt n takes you to the next one.

Alt h displays the history for the current input line.

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.

Other parts of the Midnight Commander use some of the same movement keys, so this section may be of use for those parts too.

Up, C p
moves one line backward.

Down, C n
moves one line forward.

Prev Page, Page Up, Alt v
moves one page up.

Next Page, Page Down, C v
moves one page down.

Home, A1
moves to the beginning.

End, C1
move to the end.

The help viewer and the file viewer accept the following keys in addition the to ones mentioned above:

b, C b, C h, Backspace, Delete
moves one page up.

Space bar
moves one page down.

u, d moves one half of a page up or down.

g, G moves to the beginning or to the end.

Input Line Keys
The input lines (they are used for the command line and for the query dialogs in the program) accept these keys:

C a puts the cursor at the beginning of line.

C e puts the cursor at the end of the line.

C b, move left
move the cursor one position left.

C f, move right
move the cursor one position right.

Alt f moves one word forward.

Alt b moves one word backward.

C h, backspace
delete the previous character.

C d, Delete
delete the character in the point (over the cursor).

C @ sets the mark for cutting.

C w copies the text between the cursor and the mark to a kill buffer and removes the text from the input line.

Alt w copies the text between the cursor and the mark to a kill buffer.

C y yanks back the contents of the kill buffer.

C k kills the text from the cursor to the end of the line.

Alt p, Alt n
Use these keys to browse through the command history. Alt p takes you to the last entry, Alt n takes you to the next one.

Alt C h, Alt Backspace
delete one word backward.

Alt Tab
does the filename, command, variable, username and hostname completion for you.


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

The Left and Right Menus allow you to modify the appearance of the left and right directory panels.

The File Menu lists the actions you can perform on the currently selected file or the tagged files.

The Command Menu lists the actions which are more general and bear no relation to the currently selected file or the tagged files.

The Options Menu lists the actions which allow you to customize the Midnight Commander.

Left and Right (Above and Below) Menus
The outlook of the directory panels can be changed from the Left and Right menus (they are named Above and Below when the horizontal panel split is chosen
from the Layout options dialog).

Listing Mode...
The listing mode view is used to display a listing of files, there are four different listing modes available: Full, Brief, Long and User. The full direc Äê
tory view shows the file name, the size of the file and the modification time.

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 ls l command. The long view takes the whole screen width.

If you choose the "User" display format, then you have to specify the display format.

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.

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.

After this you add the name of the fields with an optional size specifier. This are the available fields you may display:

name displays the file name.

size displays the file size.

bsize is an alternative form of the size format. It displays the size of the files and for directories it just shows SUB DIR or UP DIR.

type displays a one character wide type field. This character is similar to what is displayed by ls with the F flag * for executable files, / for
directories, @ for links, = for sockets, for character devices, + for block devices, | for pipes, ~ for symbolic links to directories and ! for
stale symlinks (links that point nowhere).

mark an asterisk if the file is tagged, a space if it's not.

mtime file's last modification time.

atime file's last access time.

ctime file's status change time.

perm a string representing the current permission bits of the file.

mode an octal value with the current permission bits of the file.

nlink the number of links to the file.

ngid the GID (numeric).

nuid the UID (numeric).

owner the owner of the file.

group the group of the file.

inode the inode of the file.

Also you can use following keywords to define the panel layout:

space a space in the display format.

| add a vertical line to the display format.

To force one field to a fixed size (a size specifier), you just add : followed by the number of characters you want the field to have. If the number is fol Äê
lowed by the symbol +, then the size specifies the minimal field size if the program finds out that there is more space on the screen, it will then expand
that field.

For example, the Full display corresponds to this format:

half type name | size | mtime

And the Long display corresponds to this format:

full perm space nlink space owner space group space size space mtime space name

This is a nice user display format:

half name | size:7 | type mode:3

Panels may also be set to the following modes:

Info The info view display information related to the currently selected file and if possible information about the current file system.

Tree The tree view is quite similar to the directory tree feature. See the section about it for more information.

Quick View
In this mode, the panel will switch to a reduced viewer that displays the contents of the currently selected file, if you select the panel (with the
tab key or the mouse), you will have access to the usual viewer commands.

Sort Order...
The eight sort orders are by name, by extension, by modification time, by access time, and by inode information modification time, by size, by inode and
unsorted. In the Sort order dialog box you can choose the sort order and you may also specify if you want to sort in reverse order by checking the reverse
box.

By default directories are sorted before files but this can be changed from the Options menu (option Mix all files).

Filter...
The filter command allows you to specify a shell pattern (for example *.tar.gz) which the files must match to be shown. Regardless of the filter pattern, the
directories and the links to directories are always shown in the directory panel.

Reread
The reread command reload the list of files in the directory. It is useful if other processes have created or removed files. If you have panelized file
names in a panel this will reload the directory contents and remove the panelized information (See the section External panelize for more information).

File Menu
The Midnight Commander uses the F1 F10 keys as keyboard shortcuts for commands appearing in the file menu. The escape sequences for the function keys are
terminfo capabilities kf1 trough kf10. On terminals without function key support, you can achieve the same functionality by pressing the ESC key and then a
number in the range 1 through 9 and 0 (corresponding to F1 to F9 and F10 respectively).

The File menu has the following commands (keyboard shortcuts in parentheses):

Help (F1)

Invokes the built in hypertext help viewer. Inside the help viewer, you can use the Tab key to select the next link and the Enter key to follow that link.
The keys Space and Backspace are used to move forward and backward in a help page. Press F1 again to get the full list of accepted keys.

Menu (F2)

Invoke the user menu. The user menu provides an easy way to provide users with a menu and add extra features to the Midnight Commander.

View (F3, Shift F3)

View the currently selected file. By default this invokes the Internal File Viewer but if the option "Use internal view" is off, it invokes an external file
viewer specified by the VIEWER environment variable. If VIEWER is undefined, the PAGER environment variable is tried. If PAGER is also undefined, the
"view" command is invoked. If you use Shift F3 instead, the viewer will be invoked without doing any formatting or preprocessing to the file.

Filtered View (Alt !)

This command prompts for a command and its arguments (the argument defaults to the currently selected file name), the output from such command is shown in
the internal file viewer.

Edit (F4, F14)

Press F4 to edit the highlighted file. Press F14 (usually Shift F4) to start the editor with a new, empty file. Currently they invoke the vi editor, or the
editor specified in the EDITOR environment variable, or the Internal File Editor if the use_internal_edit option is on.

Copy (F5, F15)

Press F5 to pop up an input dialog to copy the currently selected file (or the tagged files, if there is at least one file tagged) to the directory/filename
you specify in the input dialog. The destination defaults to the directory in the non selected panel. During this process, you can press C c or ESC to abort
the operation. For details about source mask (which will be usually either * or ^\(.*\)$ depending on setting of Use shell patterns) and possible wildcards
in the destination see Mask copy/rename.

F15 (usually Shift F5) is similar, but defaults to the directory in the selected panel. It always operates on the selected file, regardless of any tagged
files.

On some systems, it is possible to do the copy in the background by clicking on the background button (or pressing Alt b in the dialog box). The Background
Jobs is used to control the background process.

Link (C x l)

Create a hard link to the current file.

SymLink (C x s)

Create a symbolic link to the current file. To those of you who don't know what links are: creating a link to a file is a bit like copying the file, but both
the source filename and the destination filename represent the same file image. For example, if you edit one of these files, all changes you make will appear
in both files. Some people call links aliases or shortcuts.

A hard link appears as a real file. After making it, there is no way of telling which one is the original and which is the link. If you delete either one of
them the other one is still intact. It is very difficult to notice that the files represent the same image. Use hard links when you don't even want to know.

A symbolic link is a reference to the name of the original file. If the original file is deleted the symbolic link is useless. It is quite easy to notice
that the files represent the same image. The Midnight Commander shows an "@" sign in front of the file name if it is a symbolic link to somewhere (except to
directory, where it shows a tilde (~)). The original file which the link points to is shown on mini status line if the Show mini status option is enabled.
Use symbolic links when you want to avoid the confusion that can be caused by hard links.

Rename/Move (F6, F16)

Press F6 to pop up an input dialog to copy the currently selected file (or the tagged files, if there is at least one file tagged) to the directory/filename
you specify in the input dialog. The destination defaults to the directory in the non selected panel. For more details look at Copy (F5) operation above,
most of the things are quite similar.

F16 (usually Shift F6) is similar, but defaults to the directory in the selected panel. It always operates on the selected file, regardless of any tagged
files.

On some systems, it is possible to do the copy in the background by clicking on the background button (or pressing Alt b in the dialog box). The Background
Jobs is used to control the background process.

Mkdir (F7)

Pop up an input dialog and creates the directory specified.

Delete (F8)

Delete the currently selected file or the tagged files in the currently selected panel. During the process, you can press C c or ESC to abort the operation.

Quick cd (Alt c) Use the quick cd command if you have full command line and want to cd somewhere.

Select group (+)

This is used to select (tag) a group of files. The Midnight Commander will prompt for a selection options. When Files only checkbox is on, only files will be
selected. If Files only i


Related Topics

Apt Get Commands