Reverse History Search
What is Reverse History Search?
Reverse History Search: Search backwards through your command history as you type. Saves retyping long commands. Reverse history search finds earlier commands as you type. Press Ctrl+R in Bash or Zsh, type part of a command, and the most recent match appears. Press Ctrl+R again for older matches, Enter to run it, or an arrow key to edit it first.
Frequently asked questions about Reverse History Search
How is Reverse History Search used in practice?
It saves retyping long commands, like a Docker command with many options or the exact kubectl command you used last week.
What should you keep in mind with Reverse History Search?
Tools like fzf make it even better, showing an interactive, searchable list of your history. Increase your history size in your shell configuration so useful commands are not forgotten. And be aware that commands with passwords or tokens typed directly end up in your history too. Many shells skip commands that start with a space, which is a handy way to keep such lines out.
At a glance
| Category | Keyboard shortcuts |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |