Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Last active February 19, 2017 13:48
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nepsilon/9a40fcdc7a10199a1855e65906bef968 to your computer and use it in GitHub Desktop.
Save nepsilon/9a40fcdc7a10199a1855e65906bef968 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