Terminal GuideTerminal Guide
mc icon

Midnight Commander

File Managers
macOSLinux
C

Classic dual-pane file manager with built-in editor.

Official Website

Features

Dual PaneBuilt-in EditorFTP SupportArchive Support

Installation

Homebrew
brew install midnight-commander
APT (Debian/Ubuntu)
apt install mc
Pacman (Arch)
pacman -S mc
DNF (Fedora)
dnf install mc

Why use Midnight Commander?

Two-Pane Layout

Traditional Norton Commander-style two-pane structure. Always see copy/move destination while operating, intuitive file management.

Built-in Editor & Viewer

Powerful built-in editor (mcedit) and viewer included. Supports syntax highlighting, find & replace, macros, and more.

Virtual File System

Operate on FTP, SFTP, SMB, and archives (tar, zip, rpm, etc.) as if they were regular directories.

Mouse Support

Full mouse support despite being a terminal file manager. Beginner-friendly interface.

Installation

Installation Commands
# Homebrew (macOS)
brew install midnight-commander

# APT (Debian/Ubuntu)
sudo apt install mc

# Pacman (Arch Linux)
sudo pacman -S mc

# DNF (Fedora/RHEL)
sudo dnf install mc

# Zypper (openSUSE)
sudo zypper install mc

Screen Layout

Midnight Commander uses the traditional two-pane layout. Command line and function key hints are shown at the bottom.

┌─ Left Panel (/home/user) ──────────────┬─ Right Panel (/var/log) ─────────────────┐
│ Name                    Size      Date  │ Name                    Size      Date  │
│ ..                      Parent dir     │ ..                      Parent dir     │
│ .config/                4096  Jan 15 09 │ alternatives.log        1234  Jan 20 10 │
│ .local/                 4096  Jan 14 18 │ apt/                    4096  Jan 20 10 │
│ Documents/              4096  Jan 20 14 │ auth.log               45678  Jan 20 15 │
│>Downloads/              4096  Jan 20 15 │ boot.log                 890  Jan 18 08 │
│ Pictures/               4096  Jan 10 09 │ dpkg.log               12345  Jan 20 14 │
│ .bashrc                  220  Dec 01 12 │ kern.log               67890  Jan 20 15 │
│ .profile                 807  Dec 01 12 │ syslog                123456  Jan 20 15 │
│                                         │                                         │
├─────────────────────────────────────────┴─────────────────────────────────────────┤
│ Hint: Click to select file, double-click to open                                 │
├───────────────────────────────────────────────────────────────────────────────────┤
│ user@hostname:~$ _                                                                │
├───────────────────────────────────────────────────────────────────────────────────┤
│1Help 2Menu 3View 4Edit 5Copy 6Move 7Mkdir 8Delete 9Menu 10Quit              │
└───────────────────────────────────────────────────────────────────────────────────┘

Basic Operations

KeyAction
↑ / ↓Move up/down
EnterEnter directory / Execute file
TabMove between panels
F1Help
F9Open menu
F10Quit
Ctrl+OHide panels and show shell
Ctrl+\Directory hotlist

File Operations

KeyAction
InsertSelect/deselect file
+Select by pattern
-Deselect by pattern
*Invert selection
F3View file
F4Edit file
F5Copy (to other panel)
F6Move/Rename
F7Create directory
F8Delete

Virtual File System (VFS)

Midnight Commander can operate on various protocols and archive formats as if they were regular directories.

Network Protocols

  • ftp:// - FTP connection
  • sftp:// - SFTP (SSH)
  • sh:// - Shell (SSH)
  • smb:// - Samba/Windows shares

Archive Formats

  • .tar.gz, .tgz - tar + gzip
  • .tar.bz2 - tar + bzip2
  • .zip - ZIP archive
  • .rpm, .deb - Packages
FTP/SFTP Connection Methods
# FTP/SFTP connection
# F9 -> Left/Right -> Shell link... or FTP link...

# Connect directly from command line
mc ftp://user@server.com/path
mc sftp://user@server.com/path
mc sh://user@server.com/path

# Include password (not recommended)
mc ftp://user:password@server.com/path

# When using SSH keys
mc sh://user@server.com/path
# Settings from ~/.ssh/config will be used

Configuration & Customization

Configure via the F9 menu GUI or edit configuration files directly.

~/.config/mc/ini
# Configure mc via F9 menu or edit config file directly

# ~/.config/mc/ini
[Midnight-Commander]
verbose=true
shell_patterns=true
auto_save_setup=true
auto_menu=false
use_internal_view=true
use_internal_edit=true
clear_before_exec=true
safe_delete=true
mouse_repeat_rate=100
double_click_speed=250
skin=modarin256-defbg

[Layout]
equal_split=1
first_panel_size=80
message_visible=1
keybar_visible=1
xterm_title=1
command_prompt=1

[Panels]
show_mini_info=true
kilobyte_si=false
mix_all_files=false
show_backups=true
show_dot_files=true
fast_reload=false
fast_reload_msg_shown=false
select_flags=6
quick_search_mode=2
simple_swap=false

Built-in Editor (mcedit) Configuration

~/.config/mc/ini
# ~/.config/mc/ini [Misc] section
[Misc]
display_codepage=UTF-8
source_codepage=Other...
autodetect_langstrstrstrstrstrstrstrstrstrstrstrstrstr
find_ignore_dirs=

# Built-in editor settings
[Edit]
editor_tab_spacing=4
editor_word_wrap_line_length=72
editor_fill_tabs_with_spaces=true
editor_return_does_auto_indent=true
editor_backspace_through_tabs=false
editor_fake_half_tabs=false
editor_option_save_mode=0
editor_option_save_position=true
editor_option_auto_para_formatting=false
editor_option_typewriter_wrap=false
editor_edit_confirm_save=true
editor_syntax_highlighting=true

Built-in Editor (mcedit)

mc includes a powerful built-in editor mcedit. It can also be launched standalone with mcedit filename.

KeyAction
F2Save
F7Search
F4Replace
F3Start block selection
Ctrl+YDelete line
F10Quit

Tips

Browse Archives Directly

Press Enter on .tar.gz or .zip files to browse archive contents like a regular directory.

Quick Search

Press Ctrl+S for incremental search. Type part of filename to jump to matching files.

Hotlist (Bookmarks)

Press Ctrl+\ to show hotlist. Useful for registering frequently used directories.

Compare Function

Press Ctrl+X D for directory comparison. Compare contents of both panels with differences highlighted.

Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More