Search history with up/down arrow keys
Add the following to ~/.inputrc to search history by typing the first part of a command and then hitting the up arrow:
"\eOA": history-search-backward
"\e[A": history-search-backward
"\eOB": history-search-forward
"\e[B": history-search-forward
Now if you type, say, git into your terminal in hit the up/down arrows, you will cycle through all of the git commands in your history. This is much easier than history | grep foo. Enjoy!
Written by Eric Wendelin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Related Tags
#shell
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#