I accidentally stumbled across Ctrl+r over a decade ago and I still don’t understand properly how it works. So I usually egrep -e someInsaneRegex ~/.bash_history
The part of the tech stack that handles all these command editing and navigation shortcuts is the readline library. Check out man readline. There’s an entire section on searching. readline is used for lots of other interpreters, too.
I accidentally stumbled across Ctrl+r over a decade ago and I still don’t understand properly how it works. So I usually egrep -e someInsaneRegex ~/.bash_history
The part of the tech stack that handles all these command editing and navigation shortcuts is the readline library. Check out
man readline. There’s an entire section on searching. readline is used for lots of other interpreters, too.That is worth it for more complicated things like, “I want all commands that started with git and contained ‘foo’”
Did it like that before, but Ctrl-r is typically just a lot faster.
If you install a fuzzyfinder, like fzf, or skim, you get previews of the search query result and fuzzy search, which is really cool, too.