Sunday, January 21, 2007

Why I love the command line.

Last year about this time I did several workshops on how to use the command-line in a linux environment, ranging from how to log into some servers to more advanced find/xargs manipulations. I've recently been asked to do another series of workshops around the same topic. One issue is that these workshops aren't focused on code monkeys or techies. Instead they're more for folks in the humanities who have found themselves need web servers and the like.


So I guess underlying this is the fundamental question: "Why do I love the command-line so much?"

There's actually several answers:


  • It's cheap

    It sounds like a crass reason, but working with the command-line only requires a linux/unix machine or installing cygwin on Windows. Free. No needing to pay extra money for help documentation. (Like for a brief while Microsoft did with VBA for student deals). No need to have an expensive IDE or macro program.



  • It's quick and easy.

    Learning how to use the command-line may take a while, but once you do it opens up the ability to write quick and dirty commands that would otherwise require some programming. Good example: Recently there was a website where I needed documents that followed a certain filename convention, something like "*foo*bar.doc". The page that had the links had a LOT of other links. So...I do something like lynx -dump http://thepage.com | grep "foo*bar.doc" | xargs -n 1 wget



  • Acting on sets of things

    Similar to my example above, the command-line makes it pretty easy to act on sets of things, say files that meet certain criteria.



  • Easy to automate

    It's typically easier to use a series of steps in the command line environment into a script that can be automated rather then trying to automate GUI's with macros



  • Documentation

    For most Linux/Unix systems, each command has documentation, and this documentation has several tools for searching it. (Look at man, info, and apropos for some examples of command-line help systems.



  • Cause my inner-geek occasionally reveals in complexity

    Ok, so occasionally it's cool because I can do weird and complex things. Makes me feel like some great and powerful sorcerer. You can do so much with just a few words.



  • No guessing what all the little icons mean

    Ok, this is one of my pet peeves. It always seems so difficult to figure out what the heck the weird little icons do in software inspired by Windows Office icon mania. Icons can be done well. But they can be done very, very badly.