Reverse-i-search doesn't continue

I wanted to use the reverse-i-search as usual by pressing Ctrl+R to search my last ssh command. When I tried, I was only able to write "ss" but not continue with "h". Additionally when I hit Ctrl+H again, nothing happens. Does anybody have an explanation?

I am using Ubuntu 12.04 and in the pasttime this worked fine (on my other computer with the same os)


Solution 1:

Try like this:

[...] first press Ctrl+R then start typing the command or any part of the command that you are looking for. You'll see an auto-complete of a past command at your prompt. If you keep typing, more specific options will appear. You can also press Ctrl+R again as many times as you want to, this goes back in your history to the previous matching command each time

Once you see a command you like, you can either run it by pressing return, or start editing it by pressing arrows or other movement keys.

Source: Navigating Bash History with Ctrl+R.

Solution 2:

From: https://help.ubuntu.com/community/UsingTheTerminal

An extremely handy tool :: Incremental history searching

in terminal enter:

gedit  ~/.inputrc

then copy/paste and save:

"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char

FROM now on and many agree this is the most useful terminal tool saves you a lot of writing/memorizing... all you need to do to find a previous command is to enter say the first 2 or 3 letters and upward arrow will take you there quickly. Say I want:

for f in *.mid ; do timidity "$f"; done

all I need to do is enter

fo

and hit upward arrow. Command will soon appear!