Midnight Commander [mc]
Miguel de Icaza's Midnight Commander (mc) README describes mc as: a free Norton Commander Clone with many useful features... The Midnight Commander is a directory browsing tool which bears a certain remote resemblance to John Socha's Norton Commander for DOS.
Introduction
From https://midnight-commander.org/
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.
Installation
apt-get install mc
Navigation
- down arrow, Ctrl-n - move forward one line
- up arrow, Ctrl-p - move backward one line
- Page Down, Ctrl-v - move back one screen
- Page Up, Alt-v - move backward one screen
- Home, Alt-< - move to the top of the directory listing
- End, Alt-> - move to the end of the directory listing
Tagging of multiple files
The simplest is to either click on the file or directory using the right mouse button or move the highlight bar to the file and hit [INSERT] or [CTRL+T] to tag any number of files for copy, deletion, moving, and so forth.
If the files you want can be specified by a shell pattern (such as *.tar.gz for all the gzipped tar files or foo_??.txt for foo_01.txt, foo_02.txt, foo_03.txt, etc., then you can use the following shortcuts:
"+" key
Select a group of files by pattern. This will cause a dialog box to appear in which you can enter the search pattern. Note that entering the "*" wildcard will select all the files in the directory.
"*" key
Select all the files in the directory. This has the same effect as using the + key and then entering "*"
"\" or "-" key
Unselect a group of files. A dialog box similar to that with the + key will appear; if you want to unselect all files then enter "*"
Using pathname expansion (also known as filename globbing) is a fast and powerful way to select a group of similar files.
Basic File Operations
The Midnight Commander provides all of the basic UNIX file system operations including copy, delete, move, rename, link, symbolic link, chown, view, and edit. One of the nice features of mc is that it defaults to asking for confirmation before taking destructive actions such as file deletion or overwriting.This feature alone can save you a good deal of agony.
copy: F5
Normally, to copy a file from one directory to another select or tag the file(s) to copy in the current directory panel and change to the target directory in the other directory panel. Hit F5 or click on the Copy function at the bottom. If you want to use a different directory than the one in the other panel or if you want to change the file name then you can use the to: entry box to do so.
Also, when you perform a copy (and move or delete) operation mc displays a dialog box with a progress meter indicating the progress on the current file as well as the overall progress if a set of files has been selected.
delete: F8
After selecting or tagging a file or set of files hit F8 to delete them. Note that you'll be asked for confirmation. Also, mc is able to recursively delete a directory, but this, too, requires confirmation. If you're having to clean out a directory then I'd strongly suggest your using mc. It makes selecting files very easy and helps prevent costly accidental deletions.
Note that at any time you can cancel an operation by hitting the Escape key twice.
move/rename: F6
These are very similar to the copy operation described above in that the destination directory defaults to the non-current directory in the case of the move operation. Note that renaming a file entails "moving" it to another filename. In this case, use the to: entry field in the dialog box to enter the new filename.
(hard) link: Ctrl-x l
To create a hard link to a file, select that file and enter Ctrl-x followed by the letter "l". A dialog box will prompt you for the filename for the newly created link.
symbolic link: Ctrl-x s
This is the same as that for a hard link except Ctrl-x is followed by the letter "s".
chown: Ctrl-x o
To change the owner or group of a file hit Ctrl-x followed by an "o". A dialog box is presented that will allow you to select owner and group from a list of valid values.
Note that an "Advanced Chown" facility is available under the "File" menu.
mkdir: F7
While not a file operation per se, the MkDir command allows you to create a new directory in the currently active directory. A dialog box is presented that will prompt you for the new directory name.
Credit: Based on An Introduction to the Midnight Commander by by John M. Fisk <fiskjm[at]ctrvax.vanderbilt.edu>.