mc — Midnight Commander, the Visual Terminal File Manager
Practical guide to Midnight Commander (mc) — manage, edit and transfer files in the terminal with a dual-pane interface, and browse inside archives.
Midnight Commander (mc) is a visual file manager for the terminal with the classic dual-pane interface: you see a directory on the left and right, and copy, move, edit or delete files with function keys. Keep in mind that mc is third-party software and not preinstalled everywhere – install it from your package manager when needed (for example apt install mc). Through its shell VFS you can even browse inside archives and on remote servers (SSH, FTP) as if they were local folders, and with the built-in editor mcedit you edit files without leaving mc. Be aware that F8 deletes files directly; this guide walks you through the shortcuts that let you move around mc safely and fast.
Launch & Navigation
mc — Start Midnight Commander.
mcmc <dir1> <dir2> — Start with specific directories in left and right panels.
mc /var/log /tmpmc -b — Start in black and white mode (no colors).
mc -bTab — Switch between left and right panel.
TabArrow keys / Page Up / Page Down — Navigate files in the active panel.
Up/Down to move, Enter to open directoryAlt+o — Open the current directory in the other panel.
Alt+oAlt+i — Make the other panel show the same directory.
Alt+iAlt+y — Go to the previous directory in history.
Alt+yFile Operations
F5 — Copy selected file(s) to the other panel.
F5F6 — Move or rename selected file(s).
F6F7 — Create a new directory.
F7F8 — Delete selected file(s).
F8Insert — Select/deselect a file (move to next).
Insert+ (Plus) — Select files by pattern (glob/regex).
+ then type *.log- (Minus) — Deselect files by pattern.
- then type *.tmp* (Asterisk) — Invert selection (toggle all files).
*Ctrl+x c — Change file permissions (chmod).
Ctrl+x cCtrl+x o — Change file ownership (chown).
Ctrl+x oView, Edit & Search
F3 — View the selected file (internal viewer).
F3F4 — Edit the selected file (opens mcedit).
F4Alt+? — Find file by name (search dialog).
Alt+?Alt+s — Quick search: start typing a filename to jump to it.
Alt+s then type file prefixCtrl+s — Quick search forward in the file list.
Ctrl+sAlt+Shift+? — Find file by content (grep through files).
Alt+Shift+?Panel & Display
Ctrl+u — Swap left and right panels.
Ctrl+uAlt+, — Toggle horizontal/vertical panel layout.
Alt+,Ctrl+o — Toggle panels off/on (show shell output underneath).
Ctrl+oAlt+t — Cycle panel listing mode (full, brief, long, custom).
Alt+tAlt+. — Toggle hidden files (show/hide dotfiles).
Alt+.Ctrl+x t — Copy tagged filenames to the command line.
Ctrl+x tCtrl+x p — Copy the current panel path to the command line.
Ctrl+x pShell & Menu
F9 — Open the top menu bar.
F9F10 / Esc Esc — Quit Midnight Commander.
F10F2 — Open the user menu (custom commands).
F2Ctrl+Enter — Copy current filename to the command line.
Ctrl+EnterAlt+Enter — Copy current filename with full path to command line.
Alt+EnterAlt+h — Show command-line history.
Alt+hCtrl+x q — Toggle quick view (preview file in the other panel).
Ctrl+x qRemote & Archives
cd sh://<user>@<host> — Connect to a remote server via SSH (Shell VFS).
cd sh://admin@server.example.com/var/wwwcd ftp://<user>@<host> — Connect to an FTP server.
cd ftp://admin@ftp.example.comEnter (on archive) — Browse inside an archive file (tar, zip, rpm, deb, etc.).
Navigate to archive.tar.gz and press EnterF5 (inside archive) — Extract files from an archive to the other panel.
Enter archive → select files → F5Ctrl+x d — Compare directories (highlight differences).
Ctrl+x dmcedit — Internal Editor
mcedit <file> — Open a file directly in the Midnight Commander editor.
mcedit /etc/nginx/nginx.confF2 — Save the current file.
F2F10 / Esc — Quit the editor.
F10F7 — Search for text.
F7F4 — Search and replace.
F4F3 — Start / end block selection (mark text).
F3 to start, move cursor, F3 to endF5 — Copy selected block.
Select with F3, position cursor, F5F6 — Move selected block.
Select with F3, position cursor, F6F8 — Delete selected block.
Select with F3, then F8Shift+F5 — Insert file content at cursor position.
Shift+F5Ctrl+y — Delete the current line.
Ctrl+yF9 — Open the editor menu bar (File, Edit, Search, etc.).
F9Ctrl+s — Toggle syntax highlighting on/off.
Ctrl+sAlt+n — Toggle line numbers.
Alt+n Conclusion
Midnight Commander is a surprisingly complete file manager for the terminal: with two panels, function keys and the built-in editor mcedit you handle managing, editing and transferring files in one place – without a mouse and without a graphical interface. Especially strong is the shell VFS, which lets you browse archives and remote servers (SSH, FTP) like local folders. Because mc is third-party software, install it from your package manager first if needed. Be careful with the function keys: F8 deletes the tagged files directly – check your selection beforehand, because an accidental F8 on many tagged files happens fast.
Further Reading
- Midnight Commander – official site – the project home page with docs, downloads and the manual
- mc(1) manual page – the full reference for command-line options and key bindings