25 de octubre de 2011

Add forwards search to bash command history

Hi!

While using the bash console, the ctrl+r command comes extremely handy to search backwards through the command history.

But while searching backwards, we may want to be able to navigate both ways (i.e., backwards and forwards). This is not activated by default.

How to activate it? Just run this command:

$ stty -ixon -ixoff 

Tadaa! And now you can do ctrl+r and ctrl+s to navigate backwards and forwards.

You can also add this to your .profile file (in Mac OS X) or your .bashrc file (in Linux) for this to be available every time you open a Bash terminal.

Cheers!

No hay comentarios: