Contents / Previous / Next


Command History of an Interactive Shell (history)

The command history of the bash shell is saved in the file ~/.bash_history.

You can type history to get a list. Then you may grep in the list.

Bash shorthands to access the history list:
  CTRL-p (or up-arrow)   previous comment      

  CTRL-n (or down-arrow) next comment      


  !string  : Refer to the most recent command starting with string.

  !?string : Refer to the most recent command containing string.

   ^string1^string2^ : Quick substitution. Repeat the last command,
                        replacing string1 with string2. 

  !#       : The entire command line typed so far.