Midnight Commander / MC Tutorial
|
|
|
Midnight
Commander is a console file manager and directory browser. It is a
friendly system for many tasks in the terminal window, and the quickest
way to copy, move or delete multiple files. MC can also do fast ftp and
network file transfers. Access and Navigation Navigate
around mc with the keyboard:
The
'F' keys:
Are widely used in mc for file operations. Read the bar at the bottom
for the
function of each, which may differ slightly according to the context,
eg. viewing a directory will have different functions to editing
a file. Once in mc, you can keep it running and switch back and
forth to the console quickly with ctrl–o. Menus Along
the top is the drop-down menu bar, accessed with F9. Arrow across
through the different menus, then arrow down and enter on your option,
or select it quickly using the 'hotkeys' - the highlighted letters, In the Options menu, enter on Configuration. On the left of the box is 'Panel Options'. Using the space bar to toggle, mark 'drop-down menus'. When pressing F9, the Left menu will drop down, and as you arrow across the menus are displayed in turn. Sometimes, too much fiddling with the configuration messed up my mc – and I couldn't restore it as I didn't know what I had done. No problem – just delete the .mc directory in your home directory, relaunch mc and reconfigure from scratch. The profile is specific to each user. Navigating in the directory panels Your aim is to have two different directories displayed either side, so you can action files between them. If you are moving or copying files, it will assume you are actioning the files to the opposite directory – but always asks you to confirm, giving you the option to change the destination. To change directories via a parent directory, enter on /.. (usual parent directory notation) at the top of the pane, which will take you one directory up. If you have enabled 'lynx-like motion' in configuration, the back arrow will also take you into the parent directory without needing to scroll to the top. Arrow down through a directory, then Enter on your required subdirectory. Change across from side to side with Tab. Use Home and End to jump to the top or bottom of a long directory, or pg-up and pg-down to change one screen at a time. File Operations Files and directories can be moved, copied, deleted and the contents viewed easily through the F keys - always refer to the options list underneath. For more advanced operations, such as changing permissions or ownership, linking and symlinking, select File menu from the top menu bar. Arrow down to your chosen operation and Enter, use the hotkey or refer to the keyboard shortcut. Select files, single or multiple, by using Insert key to highlight them – and Insert again on any file to unselect. You can filter for multiple files: the + key will bring up a selection box into which you can enter wildcards. For instance, when I had moved a bunch of cartoon files by mistake into my Songs directory, I selected *jpg and it automatically highlighted all the cartoon files. Then F6, and it moved them across to the Cartoons directory which was selected on the other side. The delete function, F8, will handily delete non-empty directories, after confirmation. The command line Although I don't use the
command line much in mc, it should execute whatever you have
typed into it. If you wish to su, it will return you to the
terminal to type in your password. Then relaunch mc as root; if you ctl -o, it will take you back as user. Using the mouse in mc – For click-click fans The mouse works in mc, but the keyboard is handy to know when the battery goes flat in your cordless mouse... From the man page:
The Midnight Commander
comes with mouse support. When you left click on a file in the
directory panels, that file is selected; if you click with the
right button, the file is marked (or unmarked, depending on the
previous state). If a mouse button is clicked on the top frame line of the directory panel, it is scrolled one pageful backward. Correspondingly, a click on the bottom frame line will cause a scroll of one pageful forward. This frame line method works also in the Help Viewer and the Directory Tree.
If you are running the
Commander with the mouse support, you can bypass the Commander
and get the default mouse behavior (cutting and pasting text) by
holding down the Shift key. If your mouse does not work in mc, check that gpm mouse server is installed and running. Accessing Archives
All
sorts of archives - RPM, deb, tgz, iso, rar, cpio etc. are accessible
with mc. The individual files can be viewed and extracted without
needing to unpack or install.
Installation of RPM and tgz .Zip
archives can be similarly viewed and files browsed and copied before
unzipping (unzip .zip by command line only - the F2 unzip function only
works with .gz or .bz2 extensions).
Editing files with mcedit In mc, open a file to edit with F4. Once finished, F2 to save and F10 to quit (or click quit at the bottom). If it won't save your file, that means you forgot to edit it as root and now you're going to have to su and do it all over again! (Remember to relaunch mc once you are root.) Note the F keys have slightly different uses in the editor - refer to the function bar at the bottom. Mouse highlighting to copy and paste works similarly to the terminal, but use the shift key at the same time: shift, highlight, then shift and paste with the middle button. Or, paste other items on your clipboard with Shift-Insert. Using mc to FTP MC can ftp via the command line, the Left or Right menu, or to a site you have saved in your directory hotlist. Command line: For anonymous sites, the format is cd ftp://ftp.yoursite.com Left or Right dropdown menu: will connect on that respective side. Arrow down to
FTP link, or use hotkey P. A dialog box will request the FTP address in the
same format: For all methods, the username alone can be entered, eg. username@ftp.yoursite.com and and a box will request the password. If you access the site regularly, add it as a 'bookmark' to your directory hotlist
(see Command menu.)
To disconnect ftp, type cd in the command line and it
will return you to your home directory. Networking with Samba In
the same way as with ftp, select Left or Right menu and SMB link (or
hotkey B), and a box will open for the machine name. Or, command-line format:
cd smb://IP.AD.DR.ES/ Advanced users: For a detailed guide by the developers of Midnight Commander, see here. This page uploaded in a flash using Midnight Commander!
|
-
Advice for Newbies
Other Extras: ------------------------------- Independent Cycle Touring in France -------------------------------- Self-Catering Accommodation, Wilderness -------------------------------- ------------------------------- Contact Jane here for more information.
|
|
© Jane Trembath 2010. All rights reserved. / Sitemap |
|