Reverse Search
Device
- Terminal
How
- Press Control + R to start reverse search
- Type part of the command you want to find
- Press Control + R again to find the next match
- Press Enter to run the matched command, or press Control + C to cancel the search and return to a blank prompt (shell-dependent; tested in zsh/bash with default bindings)
Official documentation · Apple Support
Try this
Run a few commands like ls, pwd, and cd ~. Then press Control + R and type "cd" to see your previous cd commands appear.
Why it works
Stop retyping commands.
Don't retype — recall.
Sources
- Apple Support — Official documentation