3 ms·
This is great. Frankly ctrl-r is almost useless. I've never had it find the command I want, because if I can remember enough of the command to find it, I can ju
by pippy 7y ago
This is great. Frankly ctrl-r is almost useless. I've never had it find the command I want, because if I can remember enough of the command to find it, I can just write the whole line myself. And if it was a black magic command I'll wind up digging through log files because I won't be able to remember enough of it to find it.
- mikelyons 7y agoctrl-r works great if you have a standard command with a long file path you can't remember. Just an anecdote though.
- Izkata 7y agoIt works best for me in the opposite situation: an easy-to-remember path or subcommand, as part of a long line (usually involving if or while, and a series of commands)
- lordgrenville 7y agoI constantly use ctrl-r to reuse my most recent cd/ssh/git commit message/etc.
- stinos 7y agoSee other post, there's a solution for most of your history search problems and it's called fzf. https://github.com/junegunn/fzf https://github.com/junegunn/fzf https://github.com/kelleyma49/PSFzf https://github.com/kelleyma49/PSFzf
- codegladiator 7y agoJust tag commands with a # at the end > $ complex command here # tagHere Later use the tag with ctrl+r I do this all the time
- russfink 7y agoBrilliant! Thanks!!!
- nneonneo 7y agoI usually just do `history | grep ...` instead; it's faster and more flexible than trying to flip through Ctrl+R matches. That said, I did just install the history-search-backward and history-search-forward hooks in inputrc, and I can already tell I'll love these.
- Crinus 7y agoI do the same, except instead of `history` i grep the .bash_history file :-P (i almost always need it for stuff i typed several sessions ago)
- rmetzler 7y agocheck out https://github.com/dvorka/hstr https://github.com/dvorka/hstr which you can bind to CTRL+R. tagging with # comment is also a nice trick