Is there a way of using ctrl-r after typing part of command in bash?

Posted by skeept on Super User See other posts from Super User or by skeept
Published on 2012-01-30T15:41:24Z Indexed on 2012/11/04 23:04 UTC
Read the original article Hit count: 45

Filed under:

In bash the ctrl-r command is very useful, I type ctrl-r whatever and it searchs my history for commands containing the word whatever. But if I type whatever and realize that I would like search that word and hit ctrl-r nothing happens.

Is there a way hitting a key and having it behaving as if I had typed ctrl-r whatever instead of whatever ctrl-r?

I have the following in my .inputrc "\C-p": history-search-backward but this only works if the beginning of the line is the same.

© Super User or respective owner

Related posts about bash