Juicy lil' bytes

Bash Backward and Forward History Search

I picked up this simple modification of the bash .inputrc file a few weeks ago and it has been a great addition to my command line armamentarium. It allows you to perform a case-insensitive search through the bash history (forward or reverse) for anything that you type on the command line with the up and down arrows.

If you don’t already have a .inputrc file, create it in this path ~/.inputrc.

Then, include the following script in the file:

.inputrc script for bash case insensitive search
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on

Load your bash terminal and now you can perform a case-insensitive search for anything that you enter on the command line in a forward (with the down arrow) or reverse (with the up arrow) direction.

Kudos to Jude Robinson who posted this on Coderwall.