Last week while cleaning up my ‘stuff’ I came came across my old UNIX book from 1998. Since my job role at time was not to be a UNIX shell level programming, I never did really finish the book. I might have tried reading through the book a few times, maybe even tried out the commands and scripts. But never really completed it or retained much of it. Now, I have this love-hate relationships with books that I am not able to finish. I keep them in a bookshelf in an always visible area near my office. They serve a constant reminder of a debt, a debt that I must repay by finishing the book.
Why command line rocks? Because once you ‘own’ the command line,you actually ‘own’ the system you are working on. Sometimes when you work with remote systems,probably the command line interface is the only thing you have or can access.Even if you do not work with servers or remote system, having a few command line tricks up your sleeve will help you be more in control with your local system. Once you get the hang of it, you will quickly realize how you can merge multiple commands, write small scripts,automate your day-to-day workflows and in general get things done efficiently. Above all the command line interact is COOL, don’t trust me? Take a look at all those hollywood flicks where you have hackers working their magic using nothing but white or green text flowing across a black screen.Though its a different story that depiction of hacking couldn’t be more far from reality, but its still cool
Coming back to the book, while most of the technology related books half the age of this one are long obsolete, the UNIX command line hasn’t undergone a sea change and the book is surprisingly still very relevant. As I skimmed through the pages, I came across a command that I had perviously not used. The command was ‘zcat’, used to view the contents of a compressed file without actually having to uncompress it first. My current work computer is an iMac and almost all the commands and scripts in that book work seamlessly on the iMac. So determined and armed by my newly found knowledge I tried out the command and quickly found how easy it was to view my archive files without uncompressing them from the command line.I know the Mac OS-X has a couple of quick methods to view contents of a compressed file without uncompressing it first, but the command line was quick and easy. I am sure I will use this more often than the ‘quick look’ feature on the Mac. So for the next few days I repeated the same process and making sure not to spend more than 5 minutes with the book and trying out what I learnt. I had intentionally set this 5 minute limit to make sure I don’t go overboard with this or get overwhelmed myself.
I found this method more fun and I was no longer under stress just to complete the book and repay my debt. I must also clarify that I do spend more than 20 hours a week on the UNIX command line (mainly Debian based systems), still there was something exciting about rediscovering those hidden gems.
Here’s a quick tip if you are starting out fresh or always dreaded the command line and did not know where to begin. This awesome 30 minute tutorial will help you get started.
http://net.tutsplus.com/tutorials/tools-and-tips/the-command-line-is-your-best-friend/
It mentions the level as intermediate, but Its simple enough for beginners. Remember you don’t need to complete this in 30 minutes!
Next, pick up any UNIX reference book,cookbook or a bible. Check your old collection,attic or another places where you keep those old books, you might already one. Don’t get too overwhelmed by the size or contents. Just spend 5 minutes with a book. The idea is to learn something new and useful every day, a new command, syntax or a trick. My trick is to spend these 5 minutes early during the day when my mind is fresh and before the rush begins.
If you use a UNIX based operating system, its best. If not, you can still find a number of tools like cygwin that bring the UNIX command line interface to Windows. However these tools have their limitations and you need to aware of them to avoid frustration. My recommendation is to run a virtual machine on windows with a Linux Distribution like ubuntu.
So that’s it, give this method a try and hopefully you will have a new best friend – The Command Line Interface.