Midnight Commander stands as a powerful visual file management solution that operates within the terminal environment. Released under the GNU General Public License, this application provides comprehensive file manipulation capabilities including copy, move, delete operations on both files and directory hierarchies. The package also bundles an integrated viewer and text editor for streamlined workflow.
Key characteristics of Midnight Commander include its universal text-based interface that functions seamlessly across local consoles and terminal emulators in any graphical environment, along with full compliance to open-source licensing terms.
Installation
Administrative privileges are required for installation. Users can leverage sudo, the su command, or adjust access control permissions accordingly.
Debian-based distributions:
apt-get install mc
Red Hat-based distributions:
yum install mc
Compiling from source:
# Clone the repository via SSH
git clone git@github.com:MidnightCommander/mc.git
# Alternative: clone via HTTPS when SSH is blocked
git clone https://github.com/MidnightCommander/mc.git
Fundamental Operations
Launch the application by executing mc in the terminal. To start with a specific directory, use mc /path/to/directory.
To preserve the current directory upon exiting MC, append the following line to your ~/.bashrc configuration file:
source /usr/lib/mc/mc.sh
The interface consists of two primary areas: the dual-pane file browser and the comand prompt section.
Keyboard Navigation
When working with virtual machines or remote connections where function keys may not transmit correctly, prefix numeric keys with Escape to simulate F1 through F10:
| F1 | Display help documentation |
|---|---|
| F3 | Open internal file viewer |
| F4 | Open internal text editor |
| F9 | Access dropdown menu system |
| F10 | Terminate the aplication |
| Tab | Switch between active panels |
| Ctrl+T | Mark multiple files for batch operations |
| Delete | Remove selected files |
Command line enhancements allow standard operations like cd, cp, and mv. Press Alt+Tab to activate intelligent autocompletion for commands and filenames.
Integrated Text Editor
The built-in editor supports essential text manipulation functions:
- Selection: Navigate to the starting position and press F3 to enter selection mode, then move to the endpoint and press F3 again to highlight the desired range.
- Pasting: After selecting text, position the cursor where insertion is needed and press F5 to paste.
- Cutting: With text selected, place the cursor at the target location and press F6 to cut and move the selection.
Virtual File System
Midnight Commander enables transparent remote file access through various protocols, allowing you to browse remote systems as though they were local directories. For SSH-based connections, access the URL input via F9 + Enter + h and enter the folllowing format:
sh://[username@]hostname[:port]/[remote-path]
Parameter explanations:
- username: Authentication credentials for the remote system
- hostname: IP address or domain name of the target machine
- port: Network port number (optional parameter)
- remote-path: Absolute path to the directory on the remote server