I lost my way for a while, but now I’m coming back to orthodox file managers with Midnight Commander on Linux. I had previously been a huge fan of Far Manager on Windows.
This is not (yet?) a complete cheatsheet, just the most useful stuff (my opinion).
ENDall work as expected to move the selection
TABswitch between left and right panels
ALT-oopen selected directory in other panel (and moves selection to next directory)
ALT-iopen same directory in other panel (both will now list the same directory)
CTRL-rrefresh file/dir list
ALT-SHIFT-hopen directory history
ALT-ygo to back a directory in your history (then
ALT-uto go forward)
MC also has lots of powerful file viewing options such as:
F3- view file in built-in viewer (and
F4in viewer to view in hex mode!)
CTRL-x q- toggle "quick view" mode with viewer in other panel
Actions for files and directories
F7create new directory
SHIFT-F4create a new file
These commands work for a single selected file/dir (the highlight that moves with your keyboard’s UP and DOWN keys) or on all "tagged" files/dirs (see below).
F5copy a file (default copies from current panel to other panel)
F6move a file (default moves from current panel to other panel)
You can also give the file a different name so this is also the "rename" feature
CTRL-x cchmod - change "mode" permissions
CTRL-x schown - change owner
I already mentioned
F3 to use the internal MC viewer, which I think is great.
For editing, I prefer to use my external editor of choice (Vim) - so I use Options > Configure and uncheck "Use internal edit".
F3- view file in built-in viewer (then
F4while in viewer for hex mode!)
F4- edit file in built-in editor (but see my note above about using external editor)
"Tagging" files/dirs is like "selecting", but keep in mind that "the selection" in MC is the file/dir that is highlighted in the current panel. You can tag files by selecting them, glob patterns, and even regex:
INStag/untag a file (
SHIFT-=) tags by search pattern! (then use pattern "*" to tag all)
-untags by search pattern (again, use pattern "*" to untag all)
CTRL-x screate a relative path symbolic link to file/dir in other panel
CTRL-x vsame, but with relative path
Shell commands are always available in the little command line at the bottom. Just start typing to enter commands as you normally would.
CTRL-otoggles full screen subshell
One my favorite features of MC is the ability to open archived files (*.tar.gz) or remote file systems (over ftp, ssh) as if they were just another directory.
To open a FISH ("Files transferred over shell protocol") connection to a remote server via SSH when you run mc, try:
$ mc foo/ sh://myserver
foo/ is a local relative directory and
myserver is a remote machine (this example assumes that
ssh myserver would also work).
You can also use the Right panel (or Left, you decide) and select "Shell link" and type in the SSH server name (domain or alias if you have one configured in
~/ssh/config) and off you go (assuming you have keys set up and that sort of thing - a bit ouf of the scope of this article - get
ssh <server> working and you’ll be able to use
This makes one-off file transfers extremely handy.
Being a text-based interface, you can also, of course, install and use MC directly on remote systems as well in a regular terminal session. But then you’re using it "local" to that server and virtual filesystems are no longer involved.