Easy Linux File Management With Midnight Commander
Some of us over a certain age, or at least who have been using computers for some time, will remember some of the really great tools Norton used to make for MS-DOS computers, such as the Norton Utilities and Norton Commander file manager. Compared to working directly at the command line, the Norton Commander made working with files much easier – that is until we moved to Windows and had no need for it anymore. Norton’s early practicality led to a number of clones being created over the years in an attempt to replicate their success. One such clone for the Linux command line is Midnight Commander.
Using Midnight Commander
Midnight Commander is in the default repositories for many Linux systems, and can be installed on Debian and Ubuntu systems using the following commands:
“`
sudo apt-get update
sudo apt-get install mc
“`
For Red Hat and CentOS systems use:
“`
sudo yum install mc
“`
Once installed, Midnight Commander can be invoked by running this command:
“`
mc
“`
You’ll be taken straight to Midnight Commander’s default view, which is a screen broken into four distinct sections:
#1. At the top, in a light blue, is a menu bar similar to that you’d normally see on a graphical user interface.
#2. Beneath that in a darker blue are the file panes.
#3. Next, in black, is a command line.
#4. Underneath that in black and light blue are the F-key quick reference commands.
Typing in this view automatically enters a command at the command line while navigating up and down moves the highlighted cursor around the file panes with the tab key moving from one pane to the other.
File Panes
The first thing to look over is how the file panes work. You will see a left and a right file pane. When you initially launch Midnight Commander, you will see the contents of the directory that you were in when launching from the command line in each pane.
You can navigate the file system in each pane by moving the highlighted cursor up and down and pressing the *return* key when highlighting a directory to change the view to that one. The panes show the name of the file or directory, the size and the last modification time. Underneath that main part of the pane is a section that shows what is currently highlighted.
At the very bottom of the pane you will see how much space is used, and the total space available on the file system currently open in the pane. Pressing the *tab* key shifts you from one pane to the other, letting you navigate each pane independently.
At the bottom of the screen, the F-key menu shows a list of F-key numbers, and what will happen when you press each one. For example, *F1* opens the Help screen, *F2* provides a context menu (similar to right clicking on a file in a GUI), *F3* shows the contents of a file, *F4* opens the file in a text editor, and so on. *F9* is used to access the main menu at the top of the screen.
When using the main menu, the **Left** and **Right** menus provide options for managing the left and right panels respectively, such as changing the view type, sorting order and filtering what is shown. The **File** menu offers an array of useful command shortcuts for working on files, such as chmod, chown, symlinks and so on. The **Command** menu provides options that are helpful when working with your own commands in the command line. The **Options** menu has a selection of preference and appearance options for customizing Midnight Commander.
If you yourself carrying out a lot of file management at the command line, then Midnight Commander may be just the tool you need to simplify your workflow.