Ctrl+R
Then type any part of the command (filename, search string, etc)
Ctrl+R again to cycle through the matches.
(Best feature in bash)
7 0 ReplyUse fzf for a more visual search.
3 0 Reply
control shift R, then start typing, it will search your bash history
6 0 ReplyI recommend using mcfly for that, it makes it even better.
1 0 ReplyHmm, normally it's just ctrl - r... Are you sure the shift is needed on your system?
0 0 ReplySome variants have ctrl+r bound to something else
1 0 Reply
up, up, up, up, up, cd .., ah there it is.
2 0 ReplyThis is why I switched to fish; it seems to be much smarter understanding what I want to type.
2 0 ReplyYeah it's great how ctrl-r is kinda the default instead of something you have to go out of your way to use. Just start typing a command and the up arrow will only cycle through history that matches what you've typed so far.
2 0 Reply
history | grep 'command'
I use this all the time. Even better if you add it as a function.
1 0 ReplyIt's like the bus-stop-paradigm: If I wait just a bit longer and it will come. Meanwhile it would've been faster to walk.
1 0 Replyi use vi mode in zsh for that reason, its pretty good
1 0 Reply