3 ms·
Those are great, here are a couple more i find very useful: # Search for partial matches in bash history # so $ <C-p> goes to the previous command but #
by gnubardt 15y ago
Those are great, here are a couple more i find very useful:
# Search for partial matches in bash history
# so $ <C-p> goes to the previous command but
# $ s<C-p> searches through history entries that start with s
"\C-p":history-search-backward
"\C-n":history-search-forward
# add a trailing '/' when tab completing a symlink
set mark-symlinked-directories on
- aaronblohowiak 15y ago<C-r> searches through entire history backward, with partial match support
- shabble 15y agoIt seems to have an annoying habit of preserving the index of the last partial match, even if you cancel it. So when you realise you were searching for the wrong substring, cancel and start over, it won't find it because you've now gone past it in the history list. I'm still not sure of a decent solution to it (apart from using C-s to search history forward instead)
- daemianmack 15y agoI hit the Enter key.
- pacemkr 15y agoIt is annoying. Generally happens to me when I "miss" the thing I was searching for and go too far. This is what I do: Ctrl + a, Ctrl + k (move to beginning, delete to end), Enter Going to a new line, resets that index. I'm sure there is a better way, but its muscle memory for me.
- daemianmack 15y agoctrl+c should cancel the search, saving you the line-editing workaround.
- sltkr 15y agoPersonally I've bound history searches to the up/down arrow to make bash behave more like the C-shell in this regard: "\e[A": history-search-backward "\e[B": history-search-forward (This was really the only thing I disliked about bash compared to csh, so imagine my delight when I found out this option existed in readline.)