Anti-Buzz: The Command-Line

by Andrew Emmott on July 10, 2012

in Anti-Buzz,General

The Buzz: Non-GUI command-line computing is impractical, the realm of odd enthusiasts who take pride in doing things the hard way.


The Anti-Buzz: While text and keyboard interfaces are not friendly to the general user, they are genuinely more practical for an advanced user.

I commonly run into the belief that using a command-line interface, (whether it is part of Linux or otherwise), is like being some gear-head who builds and maintains his own hot rod – it is just a highly technical hobby, with joy derived from learning the minutia of every moving part, satisfaction born of total control and comprehension of the machine. To an outsider it is understood that there is superior performance to be had – you don’t question that the hot rod would embarrass your station wagon in a race – but this performance increase isn’t very practical because cars are for transportation, the roads are full of rules and other drivers, and it doesn’t matter how quickly you can get from 0 to 60 if you never go that fast on your way to the grocery store anyway.

This analogy isn’t completely wrong; even professional software engineers are just hobbyists at heart. Programmers like to program and most of us have small impractical projects littering our drives, tiny hot rods that we will never use for grocery shopping. We still buy from Amazon and talk to our family with Skype just like everybody else and the fact that we can pipe a grep result through awk doesn’t really help with that.

Still, adherence to the old command-line isn’t just stubbornness or do-it-yourself-joy, there are immense practical benefits to interacting with your machine in this way. If and when I tell this to people they usually take my word for it, but trusting an expert is not the same thing as comprehension, so I intend to provide a practical example that demonstrates how a text-based interface can sometimes be better than the GUI. The goal here isn’t to convert you to Unix, just to make your Linux-friend seem a little less crazy and the world of so-called “power users” seem a little less mysterious and arrogant.

So, one thing that the average user has in common with the power user is that we all create and maintain a lot of files. We put them in folders, we keep them organized, we name them, we navigate among them, and we tend to structure this according to our own desires. Windows didn’t make you create a folder called “Job Applications” – that was your idea. The average user might not think so, but the ability to create and change the organization of your files is probably one of the most creative and empowering things you do with your computer. For casual use, the facilities provided by a GUI are adequate for the task.

Our not-so-odd scenario is that you want to organize a large batch of your photos. Let’s say you have a year’s worth of photos that you are taking off your camera. Unlike your other day-to-day activities, your camera organizes and names your photos without your input. Most picture taking devices timestamp your photos in some way, so maybe your photos are named something like 0407121027.jpg for 4 July 2012 10:27 AM. This is a reasonable thing, but you are going to have difficulty picking from these files later when you want to e-mail the choice ones to your friends, especially since this naming scheme will put July 4th and June 4th right next to each other. You can rename them, but in a GUI this is tedious to do over several hundred files – right click, select the text, type the new name. It’s a lot of typing. Even if the files could be renamed to something more readable than a big number string, you would be in better shape, and it might be even better if they were in folders.

The big advantage of a command line is that text commands allow much more complexity than a mouse and few buttons ever can. If you want a large number of things done, and those things follow some sort of pattern, then you can probably get it done quickly with a script of text commands. In this scenario, let’s say you want to take advantage of the time stamp. You could write a short script that takes in all of your photos and uses the current name to figure out how to build a folder hierarchy that goes from Year to Month to Date and throws all the photos into the correct folder. Even if you spent an hour writing the script, (which you wouldn’t if you were really well practiced), running the script would take seconds, and you would have finished something that would have taken many hours to do “by hand.” If you want your photos renamed by category, you could note which days are cat pictures and which days are wedding photos and which days are beach parties and you could similarly write a script that would work that out for you too. All of this comes at the cost of greater computer savvy and a large learning curve, but the power is undeniable.

Naturally there are more advantages than just file organization, but that is the obvious common ground. The casual user really doesn’t have a use for this extra power most of the time, and the learning curve is too high to be worth it, but at the same time your mind can become trapped by the intuitive comfort of a GUI and it can be hard to see that most of the time you lack precision, complexity and scalability with what commands you can issue to your computer. If ever you are doing some tedious, repetitive administrativia with a computer and you find yourself wishing you could automate some well-patterned task, then perhaps you have hit one of those moments where some command-line skills would save you a lot of time.

by: at .

Share

Comments on this entry are closed.

Previous post:

Next post: