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.