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.

link|improve this question
feedback

migrated from stackoverflow.com Jan 30 at 18:37

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.