How to reverse-i-search back and forth? [duplicate]

Solution 1:

There is a similar question here:

Control-r reverse-i-search in bash: how do you "reset" the search in Cygwin?

Found another similar question on Super User:

(reverse-i-search) in Bash

Apparently, both mention Ctrl+s, which may do the trick.

Hope that helps. I myself am trying to find a piece of code that does the reverse-i-search in order to check how it has been implemented exactly.

Solution 2:

CTRL + S

...solved it for me AFTER using...

stty -ixon

If CTRL+S doesn't work for you is because according to Vincenzo Pii's accepted answer in another related thread:

The problem is that this binding, in many terminals, is used by default to send the pause transmission code (XOF).

As in man stty:

[-]ixon
    enable XON/XOFF flow control

So, if you have this option enabled on your terminal (the output of stty -a contains ixon withouth the - sign in front), you cannot use CTRL+S in the context of reverse-i-search.

To disable it, use the following command:

stty -ixon

And CTRL+S will give you a (i-search) (non reverse).

Solution 3:

Try delete, magically worked.

Others point to CTRL+s, but it doesn't work for me.