How to Install and Use Midnight Commander in Linux
E ven if it is moving or copying the files in Linux: working with files in a console environment can be a hard and tedious task for a novice user. You have to remember every syntax to perform a function. In the GUI (Graphical User Interface) environment, a File Manager helps perform these file-associated activities in seconds with just a few clicks and drag.
To overcome the issue with the console environment, Linux has a text-based File Manager known as the Midnight Commander. The article is a guide on Midnight Commander installation and its usage.
The Installation Process
Midnight Commander is not a default Linux system utility. Type the following command to install it in your system:
ubuntu@ubuntu:~$ sudo apt install mc
After the installation, launch the Midnight Commander by simply just typing “mc” in the Linux terminal:
ubuntu@ubuntu:~$ mc
The following window will appear on your screen:
Features of Midnight Commander
After launching the GUI tool, you can discover all the features it has to offer. It helps a user perform day-to-day activities such as copy, delete, directory creation, renaming, and moving a file.
As shown in the screenshot above, the Midnight Commander has two separate columns. Each window represents an active directory; use the Tab key to switch between these windows.
The midnight commander provides navigation through both mouse and keyboard. At the bottom of the Midnight Commander, the buttons are pre-fixed from F1-F10 numbers on a keyboard.
The keys allow us to perform various functions on a selected file. For example, to copy a file from one place to another, highlight the selected file and press F5. If there are multiple files to be copied, press the Insert button for each of the files to be copied.
The Midnight Commander will ask about different parameters like the Destination(To), Follow Links, Preserve Attributes, etc. If a person does not know much about these terms, the focus should only be on the To parameter as Destination is the only parameter required.
To move or rename a file, press the F6 key. To move the files from one location to the other, then the path is the required parameter. However, if you also want to rename the file, then include the “New Filename” in the To parameter, as shown in the following screenshot.
It also creates new directories, go to your desired location to place the new directory and press the F7 key.
To edit a file in the Midnight Commander, select the desired file and press the F4 key.
Once the file has been edited, use the Ctrl and the specified button to perform the desired function. For example, press Ctrl+X to exit the editor.
After file update, you can view the file by pressing the F3 key:
Similarly, other functions can be performed as well in the Midnight Commander by using the F1-F10 keys.
Internal Viewer
When you run the text editor for the first time by pressing F4, the Midnight Commander will ask to choose an editor for the file. In the console mode, there are several editors which include joe, nano, etc.
To change the editor on the Midnight Commander, press F2, and a menu will open. After that, press @ button and write the command select-editor as shown in the following screenshot:
You will be able to change your editor to the desired one.
File Permissions
Files and directories can also be restricted to read, write and execute by managing permissions using the chmod command. View the detailed description of the chmod command from man as follows:
ubuntu@ubuntu:~$ man chmod
Select a file, and press the key F9>File>chmod. The Midnight Commander will open the permissions menu, and the user can select their desired permissions.
Ownership of a File
Besides setting the file permissions, Midnight Commander also allows us to manage the file or directory ownership. We can set the privileges of the owner and group owner. Detailed information of chown can be viewed by:
ubuntu@ubuntu:~$ man chown
Use chown by pressing F9>File>Chown. The Midnight commander will open the ownership menu for the selected file to set the owner or group owner for the file from the available list of usernames and group names.
It also includes an Advanced Chown command available in the Midnight Commander. The command provides chmod and chown combination to set file or directory permissions and select both owner and group owner.
The article shows how to install Midnight Commander, a GUI tool to enable us to manage files and directories in Linux in a convenient way. The article aims at familiarizing users with the basic features of the tool. It shows keys to move around files and directories, view files, and make changes to the file with the help of Midnight Commander. The article also shows how to change user and group ownership of the files/directories and set permissions.
Welcome to the Midnight Commander Development Center
GNU Midnight Commander is a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It’s a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor are included.
Midnight Commander is based on versatile text interfaces, such as Ncurses or S-Lang, which allows it to work on a regular console, inside an X Window terminal, over SSH connections and all kinds of remote shells.
This site hosts the new home of the Midnight Commander. The main project repository has been moved from Savannah to a new Git repository hosted on GitHub.
Download
Source code
A list of the latest releases is available here. If you are interested in helping with the development please also have a look at our Git repository. In order to check out the repository tree use the following commands:
- git clone git://github.com/MidnightCommander/mc.git
- git clone https://github.com/MidnightCommander/mc.git (for those who are behind a firewall)
We also have an autosyncing Git mirror at repo.or.cz. It uses gitweb as the web-interface to Git and can therefore provide some information normally unavailable via Trac Git browser plug-in:
- git clone git://repo.or.cz/midnight-commander.git
- git clone https://repo.or.cz/r/midnight-commander.git (for those who are behind a firewall)
Binary builds
See Binaries page for details.
Issue tracking
If you have any issues, suggestions or patches, you can file a new ticket (you should be registered on this site). Please take the time to search for an already existing ticket.
Documentation
At the moment, unfortunately, Midnight Commander lacks a comprehensive set of documentation covering its common features and various best practices. A project is under way to create such a documentation. Currently we are gathering various bits of information which would be later converted to a more suitable format (DocBook, . ) in the wiki. Any help would be gladly appreciated.
Developers mailing lists
Note: mailing lists on GoogleGroups are set up to read Trac messages only and not an appropriate place to discuss MC bugs and solutions. Please use mailing lists for any MC-related discussions.
mc-devel (at) lists.midnight-commander (dot) org
Mailing list for the development-related discussions:
- Click here to subscribe;
- Click here to
- read the archives.
- read the old archives at GNOME.
mc-commits (at) googlegroups (dot) com
Mailing list reserved for the applied commits into master branch only (suitable for use as RSS):
- Click here to subscribe;
- Click here to read the archives.
mc-bugs (at) googlegroups (dot) com
Mailing list reserved for the ticket and comment notifications only (suitable for use as RSS):
- Click here to subscribe;
- Click here to read the archives.
Mailing list for the users
mc (at) lists.midnight-commander (dot) org
- Click here to subscribe;
- Click here to
- read the archives.
- read the old archives at GNOME.
Other resources
mc-dev (at) conference.jabber.org
This is our English-speaking jabber room.
Contribute
You are interested in mc and would like to improve it? Cool! Feel free to report bugs (please, use search before), attach your patches to the tickets and review the patches that are already in there. If you are going to do this on a regular basis, we’ll ask you if you’d like to join us. However, please search before reporting your issues to reduce the amount of work needed to close duplicate reports. Please also have a look at our WorkingGuideLines before you actually start messing with the ticket system.
If you are not familiar with git, you might find our GitGuideLines enlightening. It’s a short overview of the practical side of our workflow with Git.
Hack Midnight Commander
For translators
We have an account on the Transifex project. If you want help us with translations – just sign in (or log in) on the Transifex and do it :).
Some translation statistics:
- Getting started with Transifex from command line;
- Learn more about working with Transifex.
Now we don’t have TranslatorsWorkflow? (sorry), therefore all translators feel free to update translations as often as needed. In future we will create TranslatorsWorkflow? in any case.
How to Use Midnight Commander, a Visual File Manager
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $ credit .
This credit will be applied to any valid services used during your first days.Introduction
For beginners, managing files on their Linux servers from the command line can be intimidating, time-consuming, and sometimes even risky. More experienced users might want to switch to better suited tools for dealing with files and directories in many different locations. One tool that can help both Linux newbies and veterans is Midnight Commander, a Text User Interface (TUI) file manager.
A TUI facilitates interaction between users and their systems in a visually oriented way instead of typing commands. While lacking in visual components compared to a graphical user interface (GUI), a TUI offers windows, panels, menus, and mouse support.
Before You Begin
This guide is written for a non-root user. Commands that require elevated privileges are prefixed with sudo . If you’re not familiar with the sudo command, see the Users and Groups guide.
The methods in this tutorial have been tested on Debian 9. There is no special requirement to install Midnight Commander, and it works on all Linux distributions. While this file manager should work in almost identically on all Linux distributions, a particular distro may not package the exact same Midnight Commander version (4.8.18, in this case). This may result in small behavioral differences on other operating systems.
Install Midnight Commander
First, install the utility:
-
On Debian or Ubuntu run:
sudo apt-get install mc
sudo yum install mc
Launch Midnight Commander
- To start Midnight Commander with the command prompt:
Keep in mind that running as root is not a good idea unless you need to modify or delete files/directories owned by this user. In most cases, reading or copying objects owned by root doesn’t require special privileges, so try to run mc as a regular user.
При подготовке материала использовались источники:
https://rumaisaniazi008.medium.com/how-to-install-and-use-midnight-commander-in-linux-55350a9d1974
https://midnight-commander.org/
https://www.linode.com/docs/guides/how-to-install-midnight-commander/