www.ScienceOfAtomics.com/linux
Midnight Commander
The best file manager on every count

•  HOME  •  THEORY  •  PRACTICE  •    •  LOGIN  •  FORUM  •  CONTACT  • 

Click here for the mc man page

See the following for additional online tutorials:

The GNU Midnight Commander is a console file manager and directory browser. It is the quickest way to copy, move, delete and otherwise manage all files on a system. It can also do fast FTP and network file transfers. MC has its own inbuilt textfile viewer and editor, the ability to browse inside archives and to undelete files. It supports several virtual file systems (VFS) such as tarfs to view the contents of the several archive formats (tar, tgz, bz2, rpm etc.) ftpfs to browse FTP repositories of a remote server, fish to manipulate files on a remote server over ssh, and undelfs to recover deleted files.

Midnight Commander can be invoked simply by entering mc on the commandline. Its User interface has four sections:

  1. The Menu Bar
  2. The Directory Panels
  3. The Function Keys
  4. The Commandline Prompt

The Menu Bar

Located at the top of the screen, it is accessed by pressing F9. Five menus appear:

  • Left Options to control the left panel.
  • File Options to manipulate files.
  • Command Options to edit various mc configuration files.
  • Options Options to change configuration and layout.
  • Right Options to control the right panel.

The Directory Panels

Two panels occupy most of the screen. By default, each points to a Target Directory and displays a list of files and subdirectories within it. At top of the listing is the token ../ which indicates the parent (upper) directory of the Target Directory. The Up and Down Arrow keys move the cursor vertically in the active panel, and the Tab key toggles the cursor back and forth between Left and Right Panels. Both Panels can display the same Target Directory, but normally they will display different directories, when the active directory becomes the Source for copying or moving files, and the inactive directory becomes the Destination.

The Commandline

The commandline is always present beneath the panels for entering and executing commands. The panels disappear whilst the command is executing, and the Configuration menu allows them to return immediately or after a keypress. Alt-Enter copies the filename beneath the cursor to the commandline, and is a real time-saver.

Function Key Bindings

The Function keys are widely used in mc for file operations. Read the bar at the bottom for their current function, which may differ according to the context, eg. browsing a directory, using the file viewer, or the editor.

F1Help. More readable than the 2000-line man page, although difficult to browse.
F2User menu. Offers options to gzip files, etc. and can be suxtomized by the User.
F3View the file under the cursor or view the contents of an rpm or tgz file.
F4Edit the file under the cursor.
F5Copy the file or directory under the cursor, or selected files and directories.
F6Rename or move the file or directory under the cursor or selected files and directories.
F7Create a directory.
F8Delete the file or directory under the cursor or selected files and directories.
F9Open the Menu Bar.
F10Quit mc.

Common Keybindings

Up & Down ArrowsMove cursor vertically in the active panel.
TabToggle the cursor between Left and Right Panels. In menus, moves sequentially through selection boxes.
Ctrl–OToggle the panels On and Off to reveal the console command screen beneath.
Ctrl-\Open directory hotlist (bookmarks).
Alt-CQuick cd (directory change.
InsertToggle select and deselect of the file beneath the cursor.
Shift-+Select group. Wildcards can be entered to select files.
Keypad-+Select group. Wildcards can be entered to select files.
\Unselect group. Opposite of Shift-+
(Shift) *Invert selection.
Ctrl-RRefresh or rescan directory listing.
Ctrl-X DCompare directories (release Ctrl-X before pressing D)
Ctrl-X CInvoke chmod on the file or directory under the cursor or the selected files or directories.
Ctrl-X OInvoke chown on the file or directory under the cursor or the selected files or directories.
Ctrl-X SCreate a symlink to the selected file in the opposite panel.
Alt-EnterCopy the filename beneath the cursor to the commandline.
Space BarIn menus, toggle tick boxes on and off.