History tricks in Bash
- ! ! - Last command
- !n - Get the "n" th command
- !-n - Get "-n" command from the current command
- !str - Get the command which matches "str"
- ^str1^str2 - Replace str1 by str2 for the last command
Flock onto the best bits of technology!
fc is built-in shell command which you can use to check up on the most recent commands that you executed
So you do
fc -l -to list the last 16 commands that you entered
or
fc -l a -to list commands starting from any command starting with "a"
There are quite a few other options as well - try it out