Search Bash History
To see the most recent commands:
Executing Commands from Bash History
Record 89 in your history
Two commands ago
Rerun the previous command
Rerun the previous command as sudo
Run the previous command and make a substitution
Update your record keeping
Open your ~/.bashrc
file and change or add these settings:
This will keep the last 5000 commands in memory, and the last 10000 lines on disk. It will also append to the Bash history file instead of overwriting it.
The new h
alias means we can just type h | grep ssh
intead of using the entire command.
Make searching more intuitive
History searching with arrow keys
Shortcut for grepping
Grep for a word or phrase and remove previous instances of searching
Use an additional tool
https://github.com/dvorka/hstr