How to Use Midnight Commander, a Visual File Manager
Last Updated :
20 Feb, 2024
For Unix-like systems, Midnight Commander (MC) is a potent visual file manager with an easy-to-use interface for organizing and managing files and directories. It is perfect for distant servers and systems without graphical user interfaces because it functions in a text-based environment. The fundamentals of using Midnight Commander to manage files and directories effectively from the command line are covered in this article. With the two-pane interface that Midnight Commander offers, users may use keyboard shortcuts to traverse across folders and carry out different file actions.
What is Midnight Commander?
For Unix-like operating systems, Midnight Commander, sometimes shortened to "mc," is a strong and well-liked text-based file manager. It offers an easy-to-use interface for handling directories and files in a terminal environment. The following are a few of Midnight Commander's main features:
- Two-Panel Interface: Midnight Commander has two distinct panels that let users view and manage files and directories at the same time. File activities like copying, transferring, and comparing files between directories are made simple by this arrangement.
- File Operations: There are many other file operations that Midnight Commander can perform, such as copying, moving, renaming, deleting, and creating directories and files. An easy-to-use menu-driven interface or keyboard shortcuts can be used by users to carry out these tasks.
- File Viewer: A built-in file viewer for a variety of file formats, including text, binary, and archive files, is available in Midnight Commander. Files can be instantly seen by users without requiring them to be opened in other programs.
- File Compression and Extraction: Using well-known archive formats like ZIP, TAR, GZIP, and BZIP2, users of Midnight Commander may compress and extract files and folders. Large-scale file management and archiving are made easier by this functionality.
How to install Midnight Commander on Linux Distributions?
For Ubuntu-based distributions (such as Ubuntu, Linux Mint, etc.):
sudo apt-get install mc
-768.png)
For Red Hat-based distributions (such as Fedora, CentOS, RHEL, etc.):
sudo dnf install mc
OR
sudo yum install mc
For Arch-based distributions (such as Arch Linux, Manjaro, etc.):
sudo pacman -s install mc
How to Use Midnight Commander?
In this section, we will explore the practical usage of Midnight Commander on Ubuntu OS. We will see the various examples of performing file actions using this File Manager.
Example 1: Opening Midnight Commander
To open Midnight Commander, simply type "mc" in your terminal and press Enter. This command launches the Midnight Commander file manager, providing a user-friendly interface for file navigation and management on Ubuntu OS.
mc

Example 2: Navigating Through Directories
Step 1: To navigate through directories in Midnight Commander, use the Tab or arrow keys to switch between the two panes. This enables seamless movement between files and folders, enhancing efficiency in file exploration and management within the Midnight Commander interface.

Step 2: To open a file or navigate into a directory in Midnight Commander, simply press Enter after selecting the desired file or directory. This action allows for quick access to files and further exploration within the chosen directory.
Example 3: File Operations
1. Copying Files
To copy files in Midnight Commander, use the arrow keys to select the files or directories you want to copy, then press F5. This initiates the copy operation, allowing you to choose the destination directory for the copied files.

2. Moving Files:
To move files in Midnight Commander, select the desired files or directories using the arrow keys, and then press F6. This triggers the move operation, and you can choose the destination directory for the moved files. Midnight Commander simplifies file management by providing a straightforward way to move selected items within its user-friendly interface.

3. Deleting Files:
To delete files or folders in Midnight Commander, select the items you want to remove using the arrow keys, and then press F8. This action triggers the delete operation, prompting you to confirm the deletion. Midnight Commander streamlines the process of file deletion with the F8 key, enhancing efficiency in managing files within its interface.

4. Creating a New Directory:
To make a new directory in Midnight Commander, press F7. This action prompts you to enter the name of the new directory and once confirmed, a fresh directory is created in the current location. Midnight Commander provides a convenient shortcut with F7 for quickly and easily adding new directories within its file management interface.

5. Accessing the Menu:
To access the menu for additional operations, such as renaming files or altering permissions, press F9. This opens a menu with various options, allowing you to perform advanced file-related tasks within Midnight Commander. The F9 key provides a gateway to a range of functionalities beyond basic file operations, enhancing the versatility of the file manager.
Example 4: Other Useful Features
- To toggle the display of hidden files, press Ctrl+O.
- Open a new tab with Ctrl+X followed by Ctrl+T.
- Search for files or directories using Ctrl+.
- Refresh the current panel with Ctrl+R.
These keyboard shortcuts showcase additional features in Midnight Commander, providing quick access to functions like displaying hidden files, opening new tabs, searching, and refreshing the interface.

Example 5: Exiting Midnight Commander
To exit Midnight Commander, press F10 or Ctrl+O, then press "x". This key combination ensures a prompt exit from the Midnight Commander file manager, allowing you to close the application and return to the terminal.
.png)
Frequently Asked Questions on Midnight Commander, a Visual File Manager - FAQs
What is Midnight Commander (MC)?
For Unix-like operating systems, Midnight Commander—often shortened to MC—is a text-based visual file manager. It offers an easy-to-use interface for handling directories and files in a terminal environment.
How do I start Midnight Commander?
Just open a terminal, type mc, and hit Enter to launch Midnight Commander. The Midnight Commander interface will open as a result.
How do I navigate through directories in Midnight Commander?
In Midnight Commander, you can move between files and directories by using the Tab key or the arrow keys. The Enter key can also be used to open directories and see what's inside of them.
How do I copy or move files in Midnight Commander?
Navigate to the source file or directory in Midnight Commander, select it with the Space key, navigate to the destination directory, and then hit F5 for copying or F6 for moving files. Verify the action by hitting Enter.
Can I delete files or directories in Midnight Commander?
In Midnight Commander, it is possible to remove files or directories by selecting the desired file or directory, hitting the F8 key, and then confirming the deletion.
How do I search for files in Midnight Commander?
By using the F9 key to access the main menu, choosing the "Find File" option, entering your search parameters, and hitting Enter, you can search for files with Midnight Commander.
Does Midnight Commander support file compression and extraction?
Yes, file compression and extraction for a variety of archive formats, including ZIP, TAR, GZIP, and BZIP2, are supported by Midnight Commander. By selecting the files, hitting the F2 key, and selecting the desired action, you can compress or extract them.
Conclusion
In conclusion, a flexible file manager, Midnight Commander makes file management chores easier in text-based environments. Without a graphical user interface, users may copy, move, delete, and execute other file operations with ease thanks to its user-friendly interface and keyboard shortcuts. On Unix-like systems, users can increase productivity and optimize their file management workflows by becoming proficient with Midnight Commander.
Similar Reads
How to Use Midnight Commander, a Visual File Manager
For Unix-like systems, Midnight Commander (MC) is a potent visual file manager with an easy-to-use interface for organizing and managing files and directories. It is perfect for distant servers and systems without graphical user interfaces because it functions in a text-based environment. The fundam
6 min read
Viewing typescript .ts files in Midnight Commander
TypeScript is an important and popular framework developed in 2012 that is used in our daily life for the development of various applications. We can simply install any text editor Such as Visual Studio Code or sublime text editor to edit and manage our code files but whenever we are working on Linu
6 min read
How to Hide files using Command-line Interface?
If you're looking to hide files using the command line, it's a quick and efficient way to protect sensitive data on your system. Whether on Windows, macOS, or Linux, you can use the command line to hide files or folders with just a few simple commands. This guide will help you understand how to hide
3 min read
How to Create a Text File Using the Command Line in Linux
The Linux command line is a powerful tool that allows you to manage your system with precision and speed. One of the most common tasks is creating a text file, which can be achieved using several commands and methods. Here we will learn some quick ways to create a text file from the Linux Command Li
6 min read
How to Move File in Linux | mv Command
The `mv` command in Linux is like a superhero tool that can do a bunch of cool stuff with your files and folders. Think of it as a digital moving truck that helps you shift things around in your computer. Whether you want to tidy up your folders, give your files new names, or send them to different
7 min read
How to View the Content of File in Linux | cat Command
The cat command in Linux is more than just a simple tool, it's a versatile companion for various file-related operations, allowing users to view, concatenate, create, copy, merge, and manipulate file contents. Let's see the details of some frequently used cat commands, understanding each example alo
7 min read
How to Create a VIM File in Linux CMD
In Linux, there are many ways to open and create files, but Vim stands out as a powerful and versatile text editor. It comes pre-installed on most Linux systems and allows you to create, edit, and manage files directly from the terminal. In this article, we will explain you, how to create a new file
3 min read
How to List Open Files in Linux | lsof Command
In the world of Linux, understanding and managing open files is crucial for system administrators and users alike. The Linux operating system provides a powerful utility called lsof (List Open Files) that allows users to gain insights into the files currently open on their system. In this article, w
7 min read
How to Integrate Figma with Visual Studio Code and Other Tools?
Integrating Figma with other design and development tools can make your work much easier and faster. By connecting Figma to the tools you already use, you can improve your design process, work better with your team, and smoothly hand off designs to developers. In this article, we'll show you how to
4 min read
How to use 'cp' command to exclude a specific directory
The cp command is used to create an exact copy of the contents of files and directories but with a different name and location. It works using the terminal. Syntaxcp [source_file/directory] [destination]Where cp is used for the copy, source_file provides the exact file or directory or folder from wh
4 min read