Examples of runnning a command from the history list

To move up and down the command list one command at a time:

   history
      1  cd tmp
      2  14:00  ls
      3  14:01  cd SUMI
      4  14:05  less README
      5  14:12  cd
      6  14:15  history
   ^P
   history^P
   cd^P
   less^N
   cd^N
   history

Any previous command can be edited once it is displayed. To re-run the command press the <RETURN> key.


To re-run a specific command:

   !3
   cd

This re-runs command number three (3) in the command history.


To re-run the most recent command that starts with a particular character string:

   !pw
   pwd
   /home/grace

This re-runs the command pwd.


To re-run the most recent command that contains a particular character string:

   !?st
   history

This re-runs the history command.


[Home] [Search] [Index] This site maintained by unixhelp@mathcs.duq.edu