Previous Page | Next Page

  1. Agustin's Linux Manual
  2. System Administration
  3. About the Author
  4. Contents
  5. Administration
  6. Terminals
  7. Command Basics
  8. Root Directory
  9. Executing Commands
  10. File specs
  11. File Permission
  12. How permissions are assigned
  13. Change ownership chown
  14. Running multiple commands
  15. Killing Processes
  16. Bash configuration files
  17. VI Editor
  18. Creating path environment
  19. Midnight Commander
  20. Linuxconf Utility
  21. Networking
  22. Domain Name Service DNS
  23. Router and Gateway
  24. Adding Users
  25. User Accounts
  26. Managing Groups
  27. Mounting File System
  28. NFS Mounts
  29. Disk Quotas
  30. Run levels
  31. Linuxconf Control
  32. Mandrake Control Center
  33. Creating a Boot Disk
  34. Switching Boot Mode
  35. Hardware Configurations
  36. Printer Configuration
  37. Installing Printers
  38. Samba Printer
  39. Managing services
  40. Managing Users
  41. Program Scheduler
  42. Software Management
  43. Installing CUPS

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
midnight commander
Fig 3.2

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.

file copy
Fig 3.3

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. 3.2, 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.

function commands
Fig 3.4

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.

file menu
Fig 3.5

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.

chmod command
Fig 3.6

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.

command menu
Fig 3.7
start at
Fig 3.8

Look at Figure 3.8; 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.