Reverse Search

Device

  • Terminal

How

  1. Press Control + R to start reverse search
  2. Type part of the command you want to find
  3. Press Control + R again to find the next match
  4. 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
Open full demonstration ↗