🔽🔼
Font Size
Linux and OS X console: Are you working too hard?
Categories: Mac, Coding
by Admin on Saturday, June 27th, 2015 at 16:05:22

Recently, I had a friend, a serious Linux aficionado, come over and we had occasion to sit in front of my machine while I was doing some console work. I do a lot of work under OSX using the GUI, and previously that is what had been on-screen when he had visited. This time, however, I had some consoles open to one of my web servers.

I did a few things during which he was uncharacteristically silent. During a pause in my typing, he spoke up with a note of real interest: "That's unbelievably awesome. What is that?"

"Midnight Commander", I told him.

Now he uses Midnight commander too. All the time. I thought I'd tell you why.

Midnight Commander is a program that allows you to work at many times the rate you would if you were simply typing console commands. While you are far better informed than you would otherwise be.

It's a file manager for the console (if you're familiar with Norton Commander, that's exactly the type of application this is), but to call it "a file manager" is to understate the case dramatically. You need to understand up front that Midnight Commander is a very mature application. It is simply chock-full of useful capabilities. It doesn't 100% replace the console, but it comes very close.

You can have multiple panes showing you different directories. You can copy and move between these directories with great ease without ever typing a file name. These directories can be on different machines using either FTP or SSL connections. You can change permissions, run arbitrary console commands at any time, even on files in the various directory panes. You can sort, view, change and otherwise variously mess with things in oodles of useful ways many times faster than you can from the command line. You can directly see and navigate inside .tar archives, zips and more. There's a built-in screen editor you can enable that is syntax-aware and just generally a pleasure to use, or you can continue to use whatever console-based editor you prefer (but you really should learn to use Midnight Commander's editor. Trust me.)

There's still more — a whole lot more — but suffice to say that once you wrap your head around Midnight Commander, you'll be a convert to it forever.

For Linux, typically you update your distribution and then use apt-get or whatever package manager you prefer to install mc — I did it this way:

 sudo apt-get install mc 

For OSX, it's a little tougher to find an easy installation, particularly for the latest versions of Midnight Commander, but there are .dmg files out there that will do it for you. It is entirely worth the effort; I encourage you to get after it right away.

Installing from source code is tough; Midnight Commander's compilation process is riddled with dependencies. Under OSX as supplied from Apple, these are quite difficult to resolve without adding a lot of other things as well. Still, it can be done; I've done it.

Some of the generalized make-OSX-support-Linux packages such as fink and MacPorts can make this a lot easier, but beware: I've tried both of these, and they arbitrarily change some of the system software, such as the installed Python and Perl versions.

If that's okay with you, then by all means, go that route. If new versions of things like Python and Perl are going to break your code, I'd advise you to go about this very carefully. Perl in particular has a tendency to go from working scripts to non-working scripts when you change installed versions.

Want to add a comment to this post? Click here to email it to me.

0.01 [Cached]