Navigate Command History
Bash uses [readline] (https://linux.die.net/man/3/readline), man readline
{,bash} to check the default shortcuts. - Use arrow up/down to navigate command history
Using Ctrl+R to search history
- press ctrl-r repeatedly to cycle through the matches.
Partial Search
- To use up and arrow for partial search, add the following at ~/.inputrc
- Some command line tools may use editline, to use up and arrow for partial search for these tools, add the above configuration at ~/.editrc
man editline
history | grep
Rerun previous command that starts with the prefix
!the_prefix
Misc tips about search history
- ctrl-x -> ctrl-e opens the current command in an editor for multi-line editing
- Better Bash History
- The Awesome .bashrc File