Pages

12 May 2011

The great misconception of the command line

I started using computers in high school in the 80's. Back to those days it was Dos or Nothing so typing commands at the terminal emulator came as a natural thing to me. In fact it was one of the reasons why I decided to adopt Debian as a sole operating system some years ago (Woody but just for 4 or 5 months till Sarge was released)

But make no mistake, most of the time I am a desktop user just like everybody else with a difference perhaps. I always have at least one terminal window open performing one of my everyday tasks: running one of my home-grown scripts or screen(+irssi) or wget or whatever. I just need to tell you that I'm hooked on centerim (formerly known as centericq) since Etch. I just can't do without them all.

I found that many people, especially newbies, are a bit scared of the command line because they believe that they have to learn a million commands. And that is totally incorrect. It is true that you have to learn a lot of things to use the command line proficiently but it really is not that hard.

Take screen for example. It has perhaps a hundred options and key bindings but the average user has more than enough with 8-10 of them. Besides most options are mnemonic like d = detach r = reattach p = previous n = next S = split ... So it is not complicated.

The shell is perhaps the most powerful tool for sysadmins but this is true for everyone alike: the more you use the command line the more you learn to appreciate it. I have written a bunch of scripts through the years but I am definitely not an expert. Anyway I like writing shell scripts a bit more everyday.

Let me quote from one of my bedside books: The linux command line by William E. Shotts, Jr.

It's been said that “graphical user interfaces make easy tasks easy, while command line interfaces make difficult tasks possible” and this is still very true today.

There is though a really dangerous and sometimes evil command. It is:

(Do not try this at home!!!)

# rm -r *

I know I shouldn't use it as carelessly as I sometimes do, but it comes in handy on certain occasions.

Well, what else can I say? I have had some unwanted surprises. The only solution would be using this alias:

alias rm -r *='echo are you REALLY sure? Are you mad or something?'

(But unfortunately it is not possible to do it like this because you have to create aliases without blank spaces, too bad)

One final word: Follow my advice and use and enjoy the command line. In time you'll see it is worth it!!!