Linux |
Stop retyping that long command.
In Bash with Emacs-style editing, press Ctrl + R and start typing part of an old command.
The most recent match shows up. Press Ctrl + R again to step back to older matches.
Shell shortcuts for everyday command-line work. The current tip covers Bash with Emacs-style Readline editing. Linux alone does not tell you which shell or key bindings a terminal uses.
All tidbits | 1 tip, newest first.
Use the history-search tip when you remember part of a command but not the whole line. In Bash's Emacs editing mode, Ctrl + R searches backward and another Ctrl + R finds an older match.
Read the matched command before accepting it. Enter accepts the line and runs it; a movement key leaves the search and lets you edit, while Ctrl + G cancels the search and restores the original line. Vi mode or custom bindings can behave differently.
Source: GNU Bash manual: searching command history. Context checked November 5, 2026.
This page helps you choose the right workflow. Open the full tip for its steps, platform notes and source.
Linux |
In Bash with Emacs-style editing, press Ctrl + R and start typing part of an old command.
The most recent match shows up. Press Ctrl + R again to step back to older matches.