How to use the reverse-i-search in bash

published Nov 24, 2009 11:28   by admin ( last modified Nov 24, 2009 11:28 )

A quicker alternative to hitting the up arrow to get back the old command that you typed some time ago, is to hit Ctl-r, and then type a substring from the command you're looking for.

For example if you want to type "ssh -p 1022 username@ahost.domain", if you have typed it before you can just hit Ctl-r follwed by 1022 .

If you do not get the command you are looking for, hit Ctl-r again and it will find the next line in your command history that fits the pattern.


If you want to go to some other command press ctrl+r again to move backwards This will speed up your whole process


Läs mer: Just another Programmer: reverse i search for linux users