In this post, I show you how to configure SSH for Midnight Commander to remotely copy or move files with the file manager’s Shell link feature and public key authentication. I will also explain the difference between files transferred over Shell Protocol (FISH) and Secure Copy Protocol (SCP) and say a word or two about Midnight Commander’s SFTP feature.
Tag: Midnight Commander
LinuxCommand.org: Midnight Commander
At the beginning of chapter 4 in TLCL there is a discussion of GUI-based file managers versus the traditional command line tools for file manipulation such as cp, mv, and rm. While many common file manipulations are easily done with a graphical file manager, the command line tools provide additional power and flexibility.
In this adventure we will look at Midnight Commander, a character-based directory browser and file manager that bridges the two worlds of the familiar graphical file manager and the common command line tools.
The design of Midnight Commander is based on a common concept in file managers: dual directory panes where the listings of two directories are shown at the same time. The idea is that files are moved or copied from the directory shown in one pane to the directory shown in the other. Midnight Commander can do this, and much, much more.
Link: Get started with Midnight Commander, a Linux file manager
In my previous article, 8 Linux file managers to try, I compared a number of file managers, but there was not enough space to go into detail about any of the several file managers that I mentioned briefly. This article will delve a bit further into Midnight Commander, and I plan to write more to cover some of the other file managers in more detail.
Midnight Commander (MC) is a text-based Command Line Interface (CLI) program. It is particularly useful when a GUI is not available but can also be used as a primary file manager in a terminal session even when you are using a GUI. I use Midnight Commander frequently because I often have need to interact with local and remote Linux computers using the CLI. It can be used with almost any of the common shells and remote terminals through SSH.
Full article here:
Get started with Midnight Commander, a Linux file manager (Opensource.com)
Link: Midnight Commander Custom Interface Colors
Most Linux users are already familiar with the popular Midnight Commander console file manager so I will forego the introduction. This file manager supports custom user interface color schemes for increased personalization. The color scheme can be modified conveniently at any time by editing a single configuration file.
Full article here:
Midnight Commander Custom Interface Colors (Linux Library)
Link: Do More, Faster In The Linux Terminal With Midnight Commander
This is the program we always install first in any new Linux-based installation, and if for some reason we can’t install it, that system tends to get blown away and replaced by a different version of Linux (or whatever) almost immediately. Not being able to install Midnight Commander is kind of a deal-breaker around here.
File browsing in a Linux terminal is alright, but it could be so much better. Midnight Commander is the program you’re looking for – it gives you a two-paned file browser that makes working in the terminal so much easier. And the best part? It’s simple to get and use.
Full article here:
Do More, Faster In The Linux Terminal With Midnight Commander (MakeUseOf)
We’ll just add that even some Mac OS X users are apparently lost without Midnight Commander, since an older article on installing it under OS X is still one of the most popular on this site, even though for day-to-day use, we would think that most OS X users would be happier with the more recent versions of XtraFinder, which now includes dual pane functionality (and it’s free!). As for Windows users, there is always the venerable Total Commander.
Fixing Midnight Commander’s unreadable dropdown menus
If you’ve installed Midnight Commander and haven’t changed the default colors, when you try to access a dropdown menu you may see this:
REALLY hard to read that menu, isn’t it? Wouldn’t you rather see this?
To fix the unreadable menus, just make sure Midnight Commander is not open, then use any text editor (such as nano) to open ~/.mc/ini:
nano ~/.mc/ini
Assuming that there is no existing [Colors] section in the file, just add this at the bottom of the file (if the second line exceeds the blog column width, just use copy and paste to get it all):
[Colors]
base_color=default,default:menu=black,cyan:menuhot=brightmagenta,cyan:menusel=white,blue:menuhotsel=brightmagenta,blue
If there is an existing [Colors] section, you can try tweaking it using the parameters shown above. If you have a very recent version of Midnight Commander (which you probably will have if you are running Ubuntu), then instead of menu= you’ll need to use menunormal=, as shown here:
[Colors]
base_color=default,default:menunormal=black,cyan:menuhot=brightmagenta,cyan:menusel=white,blue:menuhotsel=brightmagenta,blue
Note that for some reason the base_color parameter must appear, or the other items are ignored. Save the change, exit the editor, and open Midnight Commander. If you then close Midnight Commander, you may find that the position of the [Colors] section has moved within the ini file — apparently Midnight Commander rewrites the file when you close it — but if you don’t like the changes you can remove the [Colors] section to reverse the change.
I figured out how to do this after reading this blog post:
Ajnasz Blog – Midnight Commander colors and themes
Another source of information is:
Zagura’s blog – Midnight Commander Color Themes
How to install Midnight Commander under Mac OS X (the easiest way?)
Over the many months that this blog has been available, one of the most consistently popular posts has been, How to install Midnight Commander under Mac OS X (the easy way, using Rudix). Unfortunately, at the article notes, the developer of Rudix changed his package and while you can still use Rudix to install Midnight Commander on your Mac, it’s not quite as straightforward an installation as it once was.
This morning I received a comment from reader LouiSe on that article, that read as follows:
What do you think about an up2date universal binary installer package? … http://louise.hu/poet/tag/mc/
Well, if it works I think it’s a great idea, but I don’t have the time to fully test it and since I’m still running Leopard, I have no way to test it under Snow Leopard. So I’ll just throw it out there and say that if any of you would like to test it (at your own risk, of course) and see how well it works for you, I’d appreciate it if you’d leave a comment. For the time being, be as careful as you might be with any software from an unknown source. But if you’re daring enough to give it a try, this might indeed be the easiest way to get the latest version of Midnight Commander onto your Mac.
Since Midnight Commander is free and available for virtually all versions of Linux, learning to use it now will put you a step ahead for the day when you get sick of being seen as a cash cow by Apple, and are ready to move on to a computer that runs Linux. Ubuntu Linux in particular has finally matured to the point that it is actually usable by non-geeky types, and the vast majority of the software in the Linux world is still free. I like free software, and I don’t like watching the “spinning beach ball of death” on my Mac Mini, so unless someone gives me a newer one as a gift or something (not likely), the Mac Mini I’m using now is probably going to be the last Mac I will ever own.
How to install Midnight Commander under Mac OS X (the easy way, using Rudix)
EDIT: New article for Midnight Commander users: Fixing Midnight Commander’s unreadable dropdown menus.
EDIT: This article has been revised to show the latest information as of 2012. Note that these instructions probably will not work unless you are running a relatively recent version of OS X. Also, you really should read How to install Midnight Commander under Mac OS X (the easiest way?) before using the procedure shown here!
I have to admit, I am one of those people who dislikes Linux for one major reason: Whenever you ask for help in any online forum, the knowledgeable people all seem to be command-line devotees, and they invariably give you instructions that involve typing long, arcane commands into the command line. I hate using the command line – if I had wanted to use a command line, I’d never have moved away from MS-DOS, and i cannot understand why Linux geeks insist on using it, and on trying to get others to use it. Even users of Linux distributions such as Ubuntu have found that when they go online asking how to do some function that could easily be accomplished using one of the GUI tools, often some obnoxious twit helpful person will reply by giving a bunch of stuff (that makes no sense at all to the uninitiated) to type in at the command line. One of the things I like most about Mac OS X is that you almost never have to do anything from a terminal prompt if you don’t want to, and Mac users seem to have a healthy disdain for using a computer as if it were still the 1970’s.
Long ago, when I was using MS-DOS, there was one tool that I had to have on any system I was using: Norton Commander. The original, dual-pane file manager that made it oh-so-easy to do typical file manipulations like copying and moving files, viewing and editing text files, launching executables, etc. without typing in DOS commands. Norton Commander was such a great program that it inspired similar programs on other platforms, such as Total Commander under Windows, and the cross-platform muCommander that runs on just about anything (if it has Java installed). In the Linux world, KDE users have Krusader, and Gnome users have Gnome Commander.
Mac OS X users have a number of choices, including the aforementioned muCommander and Xfolders, both of which are free. Possibly the best alternative today is XtraFinder, which is excellent and free — it add tabs and other features to the OS X Finder, and can display dual panes in either a horizontal or vertical alignment.
However, despite your best intentions, there may come a time when you find yourself working at a shell prompt. Maybe you are working with a Linux server, or on a Mac, maybe you can’t get OS X to come up but you are able to get to a terminal prompt (in my early days of using a Mac, this happened to me twice after OS X upgrades). More commonly, you are getting a permissions error on some file and can’t understand why – that’s very rare on the Mac, but it happens, and now you find yourself in the terminal trying to remember how to change permissions or ownership on a file (by the way, in most cases you should be doing this by right-clicking on the file in Finder, then clicking on “Get Info” in the context menu, and then using the Sharing & Permissions section at the bottom of the information panel. But there are occasions when nothing else seems to work, and you want to go a bit deeper into the guts of the system). It is at those times when Midnight Commander may be the tool you want.
However, up until now there has not been a really easy way to install Midnight Commander on a Mac running OS X (at least not that I’ve seen). But now, there is a package by Rudá Moura called Rudix, which is described this way:
Rudix features a world class collection of pre-compiled and ready to use Unix compatible software which are not available from a fresh installation of Mac OS X but are popular among other Unix environments. Here you can find utilities, programming languages, libraries and tools delivered as standard Mac OS X packages.
Now, I hear some of you “cut-my-teeth-on-Unix” types screaming, “What about MacPorts? What about the Fink project?” Those are all well and good if that’s your cup of tea, but they require a much higher lever of Unix “geekiness” to install, and they add a lot of code that the typical user doesn’t need. Rudix will let you add a whole bunch of Unix utilities if you really want to do that, but if you only want a few needed utilities then the “Custom Install” button in the Rudix installation lets you select exactly what you want, and no more.
So here is how you would install Midnight Commander in Mac OS X, using Rudix:
Go to the Rudix mc: Midnight Commander page. Select the correct package for your version of OS (filename ends in .pkg) and click on the package filename. On the next page, click the package filename again to download it to your computer. When it has downloaded, double click on it to run it. You should see a screen like this:
Click “Continue” and continue to do so until it has been installed. That’s all there is to it!
I should point out that this used to be a much more convoluted process, and there was a much longer set of instructions here explaining it, but all those old instructions are superfluous now.
Once you have installed Midnight Commander, you will realize that you can easily install many other utilities commonly found on Unix/Linux systems, if they are available in the Rudix package list. Personally, I would not go hog wild on this – I’d only install the utilities you actually need, as you need them. One package I typically install is wget, because so many scripts (such as those written in Perl) expect it to be present.
Edit March 28, 2008: I made an interesting discovery tonight. Normally I use iTerm as my terminal program, and Midnight Commander runs fine in that. What it does not seem to run so well under is the Terminal.app program that comes with OS X. What specifically does not work in Terminal.app, at least on my system, is the mouse. Under iTerm, mouse clicks get passed to Midnight Commander in the normal manner, but under Terminal.app that doesn’t seem to be the case. Another thing that you can do in iTerm (but not Terminal) is hold down the ⌘ (Command) key and right click on a file to select it. So, for the “best user experience”, so to speak, I’d suggest downloading and installing iTerm, which has a lot of other nice features you’ll probably appreciate (and did I mention it’s free?).
Edit April 1, 2008: If, for some reason, you want to modify the color theme of Midnight Commander, here are a couple of blog posts that show how to do that:
And, the Midnight Commander manual is another good source of information on this subject.
Command line haters of the world, untype!
Recent Comments