whatdidi - command line history search tool
View project on GitHubA command-line utility that helps you find commands you've previously run. Searches your shell history (both persistent and current session) and retrieves matching commands based on a search term.
Features / Example Usage
Search for the last command you ran:
whatdidi curl
> curl -s https://sh.rustup.rs | bat
Search for the last n commands you ran:
whatdidi mvn 3
> mvn clean compile
> mvn test
> mvn clean compile exec:java "-Dexec.mainClass=simulator.ui.UserCLI"
Supports compound commands (e.g. search for git push specifically):
whatdidi "git push" 2
> git push
> git push -u origin main:refactoring
Supports commands prefixed with sudo:
whatdidi rm 2
> rm foo.txt
> sudo rm bar.txt