May 17, 2008

The midnight commander

The midnight commander

The midnight commander is a server network file management system; this server allows you manipulate files on a remote machine as if they were local. But of course this is only possible if the server is running.

In this section I will show you how to use midnight commander locally. Probably most of your administration will be done here if you decide to go this way. As a regular user, you can only use midnight commander to manage files in your home directory. If you need to do administration globally you need to run mc as root.

Become a super user and type (mc) on your command prompt.

                [user1@server2 user1]$su
Password:***********
[root@server2 user1]#mc

This is the midnight commander console, it may not be exotic; but I bet you it will become a lifesaver. Observe the console screen. It has two panels left and right. You can move between panels by pressing the tab key
To scroll inside the panel use the up and down arrow.

Copying File with mc

To copy files from one directory to another, you can select the directory from one panel (source), and make the destination into another panel. You can select single files or a whole directory.

Make sure you know where the destination is. Select the destination directory (when selected press enter) it opens and display its content. Select the file to copy. When ready to copy, press F5.


If it is a single file that is being copied, just use the tab key to move on OK and hit enter. If you were copying a directory with files and subdirectories, then you would mark the option [X] Dive into subdir if exists.

MC's F commands

At the bottom of fig., you can see a command line prompt; you can execute commands from here. At the very bottom are other options; these are the F1 through F10 commands.

Most of the F commands are very logical and self-explanatory; so I am not going to explain them, except the F9. The F9 is used to jump to the upper pull down menu.

After pressing F9, use the arrow keys to browse through the sub-menus. Observe that under the file option you can access options such as cHmod and chOwn; in other words file permissions.

File permission with mc

The file menu is very useful, here you can change file permissions and ownerships.


If you did not understand file permission earlier, you have the easiest way to set permissions. Select the cHmod on the file menu to see the chmod screen, figure 3.6. On this screen, you can set the permission type.

Observe the chmod command screen, on the right panel it describes the file being modified. As you change permissions the numerical (octal) permission of the file also changes.

Searching files with mc

Finding files has never been easier. Just select Find file from this menu and fill out the search starting point, the file name, Select OK and hit Enter.



Look at Figure; the start at is where you want to start searching for the file (the root directory). You can change that with any folder name or a particular partition.

Midnight commander can help you with most of the file administration. Browse through all the options and menus to find out what it is for. You may not need to use all the options. If you feel like reading, you can always read the manual by typing man mc at your command prompt. If mc is not installed, refer to the installation section in chapter 4.


No comments:

Post a Comment

Popular Posts