Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjhea0/042e60783ee51282075f2290110facd4 to your computer and use it in GitHub Desktop.
Save mjhea0/042e60783ee51282075f2290110facd4 to your computer and use it in GitHub Desktop.
Searching bash or zsh history — First published in fullweb.io issue #55

Searching bash or zsh history

More often than not, you already typed yesterday the commands you’re about to use today. Wouldn’t it be handy to be able to retrieve the long command instead of typing them yet another time?

Hit Ctrl+R, you’ll see:

(reverse-i-search)`':

This is bash (zsh prompt will be similar) opening the search interface for you. Type some letters, it will find the most recent command with these letters.

Keep pressing Ctrl+R to continue the search backward, and Ctrl+Backspace to search forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment