Thursday, 2 February 2012

Repeat previous linux commands in easy way

# !! ------- execute the last run command

# !-4 ------- executed the 4th command executed from backward

# !c  -------- execute the command that you run last, which start with the specific word c

# ctrl+P ----- will display the previous command

# ctrl+r ----- for reverse search the commands

# !141

# history | more,less 
check the command that you looking for and note its line number also
141  08:55:33 2012-02-02 clear ( her line number is 141) to execute this command run the above command !141 with the line number.

# cd !^   --------  !^ will get the next argument after cd command, which executed before.




 



 



 



No comments:

Post a Comment