My inspiration for this article came from reading Akkana Peck’s Intro to Shell Programming: Writing a Simple Web Gallery at LinuxPlanet today.
Before I get into this I will state for the record I am not a text mode Luddite. I use a graphical user interface (GUI) every day. In fact I am using the fluxbox window manager GUI as I write this article with a WordPress GUI and Firefox GUI. I like my GUI chewy goodness as much as any visually stimulated human. However, for certain tasks a GUI is just not the best choice.
The first reason is twofold, quickness and convenience. I will use for this point GNU/Linux distribution software installation and removal. If one has one’s distribution repositories set up, knows the application one wants to install and knows the command line string to use for installation on one’s GNU/Linux distribution of choice then installation is much faster at the command line. For example I want to install K9Copy, a DVD duplication application not included or installed by default on my Mandriva Linux system and included in the Penguin Liberation Front (PLF) third party repositories for Mandriva. From the GUI installer under KDE I have to use the following steps.
- Click the Menu button.
- Click “Install & Remove Software”.
- Provide the administrator (root) password.
- Wait for the user interface to load …
- Wait for the user interface to load …
- Wait for the user interface to load … finally!
- Click File > Update media
Because I want to make sure I have the latest repository updates. - Wait for the repository database to be updated.
- Type k9copy in the search bar.
- Click the check box beside K9Copy.
- Click the Apply button.
- Wait for the application installation confirmation dialog.
Dangit! I already said to do this once, now I have to say do it once more. - Click the Yes button (It is okay to continue, stupid GUI).
- Finally get the application to install.
- Wait for the GUI to reset after the install.
- Close the GUI.
Doing this set of actions can take several minutes. On the other hand I can switch from my GUI to a console login with Ctrl+Alt+F1, login as the administrator (root) and type this at the command line prompt:
urpmi.update -a && urpmi k9copy
Then switch back to my GUI with Ctrl+Alt+F7 and conveniently continue typing this article while the program installs. The urpmi.update -a command tells my installer to update its sources. The && tells the shell to do the next thing only after the first one completes. The urpmi k9copy tells my installer to install that application. The Mandriva urpm* tools are smart enough to know that k9copy is k9copy-1.2.3-1plf2008.1.i586.rpm. All this will run in the background while I get stuff done. Now that I have finished this paragraph I can switch back to the console with Ctrl+Alt+F1 and exit from the administrator session.
The second reason the command line trumps the GUI is repetitive tasks. I could illustrate this here with a clever shell script. However, I think I will refer to Akkana Peck’s article I mention at the beginning of this article. Go read it if you have not. In summary Akkana shows how to use a shell script loop to modify a directory full of JEPG files with two of the ImageMagick command line strings. While one could do this with a GUI like The GIMP I would only recommend doing it with a very few files. If one needs to modify a few hundred graphics to be a standard size for a web site gallery then the command line tools Akkana shows how to use are going to save the day.
I have seen all the arguments that Joe Sixpack could not care less about a command line. That is absolutely fine since Mr. Sixpack is more than likely only wanting to browse the web, play a few games, send and receive e-mail and work on his genealogy. All these can be done in GNU/Linux just fine without ever needing to see a command line. However, should Mr. Sixpack ever need to create a family web gallery for the Sixpack family using a few hundred digital photographs from a few dozen different cameras he will have a big task on his hands. Then maybe, just maybe he will see Akkana Peck’s article and find out an easy way to get all those pictures the right size for his gallery using the much maligned command line. I am certain our friend Mr. Sixpack will be very happy to see that command line example from Akkana if he ever needs it.
Please feel free to comment and provide some of your favorite time saving or repetitive command line tasks.
This article has been accessed this many times:
| mba programs online |
Edit: as of Fri Mar 13 17:31:30 UTC 2009 the route to hit-counter-download.com is not working. If the page seems to be taking a long time to finish loading this is why. Hopefully it will clear up soon.

I use GUI in the article for all things graphical that provide a user interface. So, GUI means graphical “desktop” or window manager and graphical applications. Basically anything the user interacts with on a monitor, that is not a pure text mode interface like the Unix console, is a GUI.
I use Gauke terminal for quick, always-on terminal access.
Richard (comment #2), thanks for the comment. I have not looked at Guake terminal in a while. Maybe I should take a look at it again.
‘Then switch back to my GUI with Ctrl+Alt+F7′
Don’t forget to close root session before
Debianero (comment #4), thanks for the suggestion. The problem is the installation application was still running at that point. If you read further you see, “Now that I have finished this paragraph I can switch back to the console with Ctrl+Alt+F1 and exit from the administrator session.”
I am a luddite!! I really wish we have NEVER moved away from the good ole terminal. Why waste all of these fabulous CPU cycles on more and more bloatware?
Why is point and click faster than b, etc. As long as the application interface has user friendly keys, why do we need a GUI layer at all?
I remember the good ole days of QEMM Deskview (think the spelling is correct). My shiny new x64 Dual core notbook runs basically the equivalent with Windows or KDE as the good ole 386 with a multi-tasking cut and paste terminal program.
Is GUI really worth it? We had Menuing systems under DOS with shortcut keys as well. GUI attracks users with pretty pictures but does not equate to more functionality and has a much higher cost.
Text scripts serve as a log of actions you consider important (the cream being that you can rerun them.. or modify and rerun.. to your heart’s content).
Text scripts, once created, can be attached to your favorite customizable gui (to get the best of both worlds.. for scripts you really like and want integrated into a gui).
“Joe Sixpack” will get smarter by using Linux.. because Linux begs to be moved along more efficiently with every secret incantation you discover.
The power of text based automation becomes clearer the more you step into that world of programming. In the limiting case, you will be writing code to define your new platform. Visual tools *enhance* text because you can use visual clues (the picture dimension) to more easily remember things. Also, for trying things out, it’s more efficient to move a mouse than to retype text with coordinates or call up a huge number of short-cuts. But most power is from text.
I love eye candy but I can’t leave without a console. I use Yakuake to have it drop down at any time with just hitting F12. What are my most used console commands? Hard to say, here are a few of my favorite command liners which I use for personal use (at my workplace I use lot of others):
- I made a simple entry in my .bashrc and defined an alias “mdvup” it updates my system (yes, Mandriva), see my website for how to do it (the text is in Romanian, but you’ll be able to find the code).
- mplayer … I love mplayer. I listen to online radio only with mplayer from command line. Why run JuK or AmaroK to listen to a radio stream?
- every time I want special features for some movies, I use mplayer from command line, it’s easier to specify tricky parameters. For some files (ie. .mkv with x.264 codec) I specified at the file association in KDE a lot of parameters, so I use VDPAU to decode HD videos. Now, it works with clicking on an .mkv file, but in the background it is a carefully constructed command line.
- quick file management over multiple hosts. I use a lot sshfs to mount remote folders, than mc to manage the files. Rarely I use directly the scp command, because it’s faster if the remote folder is mounted somewhere.
- when I have to look for logs, I never use MCC GUI. Just tail -n XX /log/file and if there are lot of stuff a grep or sed to filter the output.
- ps aux is superior to KSysguard’s list, top and kill are handy too.
- quickly check the network status … ifconfig is the fastest way.
Beside these, I have lot of little scripts (bash, perl, expect) to easy my everyday life.
I just love GNU/Linux.
I am a big fan of Yakuake, a drop down terminal for KDE. Likely very similar to Guake, but it is for KDE so it has options and features and whatnot.
You are quite right that IF you have repositories set up AND IF…AND IF… and you know the proper command, it is faster to use the command. But if all those conditions are just geek-speak to you, you have to factor in all the time it would take to figure out how to get all that stuff done, and then do it. In the total picture, GUI wins. For the repetitive tasks, of course, the command line can’t be beaten.