Monday, April 04, 2011

10 tips on working fast in UNIX

Have you ever amazed to see someone working very fast in UNIX, firing commands and doing things in mille seconds? Yes I have seen and I have always inspired to learn from those gems of guys. This article or tutorial or whatever you call it I have dedicated to share UNIX command practices I follow to work fast, quick or efficiently in UNIX. I work for financial services industry and my work involves development and support of trading application in Electronic trading, Derivatives etc. all our services runs of UNIX servers so its very important for me to work efficiently and quickly in Linux machine.
This article is in continuation of my earlier article Top 10 basic networking Commands in Unix  and Top 10 most useful CVS command in Unix  and 10 examples of using find command in UNIX .

if you have not read those you can see if you find them interesting and useful. In this unix command tutorial I am going to share my experince on how to work quick, fast and efficiently in unix.

1) Use !  For executing last command
This has saved my 30% time on average. It always happens that you fire same UNIX command multiple times within a fraction of seconds, before knowing this trick I used to use up and down arrow for finding my command and then executing them which takes some of my time but after
Knowing this trick I just have to remember command name e.g. !ls will execute your last "ls -lrt" , !vim will open your last file without
Typing full commands. Use it and experience it , It definitely save loads of time and its also useful on shell other than bash where up and down arrow generally doesn't give you previous commands.
For example After doing ls –l stocks.txt if you want to open stocks.txt you can use vi !$ (last argument)

2) use  !! for executing last command
This is an extension of previous tip which is used to execute the very last command you have executed. Since it just involves two keystrokes and that too for same key it’s amazingly fast. This will also works on the shells in which up and down arrow don’t work

3) Use "CRTL+R" for repeating the last matching command
Best out of lot if you remember your last command executed sometime back and just want to find that command with same argument and execute
This is the tip you need to remember. just press "CRTL+R" and type words that you had in your last command and UNIX will find that command for you then just press enter.