history is used to list command history. By default,
history will print the last 500 commands typed into the terminal.
$ history ... 498 third_most_recent_command 499 second_most_recent_command 500 most_recent_command 501 history
history | grep <search_string>
This option allows you to search for most recent commands containing the search string
$ history | grep cd 9 cd /home/name/secrets 11 cd topSecrets 14 history | grep cd
This shortcut runs the #th command from your history.
$ !11 cd topSecrets
This option will execute the last command starting with
$ !. ./lastExecutable with lots of command line options
!m (to run the makefile) followed by
!. saves me lots of typing time.
This options clears your history - this is for when you don’t want anyone to know that you accessed your