Wednesday, July 20, 2011

Get last bash command in shell

Suppose you want to get previously used command without using up / down arrows,

Simply type !(command start char).

Example :-

If you want to get "ps -eaf|grep java", simply type !p in the bash shell.

NOTE :- This will return last executed command.