Download this Blogger Template by Clicking Here!

Ad 468 X 60

banner

Monday 1 April 2013

Widgets

Command Line Shortcuts History MAC & LINUX

Command Line Shortcuts History 


  • Hash stores a history of commands you've entered,which can be used to repeat commands 
  • Use history command to see list of "remember"command 
          $   history
          14  cd /tmp
          15  ls  -1
          16  cd
          17cp /etc/passwd .

           ... output truncated ...

History 

In Addison to the basic command recall with the arrow keys,the bash history mechanism support a variety of advanced ways of retrieving command from the history list.

!!    repeats last command ,
!char repeats last command that started with char
!num  repeats a command by its number in history output

To view command with the history number,use the history command.

Other slightly more advanced history tricks include: 
!?abc     repeats last command that contains(as opposed to ?started with?) abc
!-n        repeats a command entered n commands back

Use ^old^new to repeats the last command with old changed to new,for example:

[student@stationX ~]$ cp filter.c  /use/local/src/project      
[student@stationX ~]$ ^filter^fronted
cp filter.c  /use/local/src/project

     THANK YOU FOR VISITED GURU NETWORK I HOPE LIKE THIS TOPIC 

SHARE THIS POST   

  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati
Author: Kuldipsinh
Hi! I am Kuldipsinh,a certified Indian Network Consultant,Pro Blogger,Computer Engineer Software Editor and an addicted Web Developer. Read More →

0 comments: