Search shell history
It happens a lot that I need to reuse a command that I've already typed a little while back. What I use in those cases is reverse-i-search, which works like this:
- Hit CTRL+r
- Start typing part of the command you're looking for, not necessarily the beginning.
- Shell shows the last command you typed that matches the search.
Now you can do the following:
- Use CTRL+r again to move up in the history to next matching command, or CTRL+SHIFT+r to move down.
- any other key quits search and leaves you at the found point in your history, using the normal behaviour of that key. So ENTER executes the found command, etc.
Written by Willem van der Jagt
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#