October 12, 2009

BASH command line history

Filed under: cool, linux, tip, tool — michaelangela @ 4:16 pm

Sweet. The page has more tips as well like getting partial stuff from your history. I don’t know how much of this will work on OSX but it’s still neat to see.

Access to command line history in BASH

To activate those two commands, add this to your .bashrc file:

bind ‘”\e[A”‘:history-search-backward
bind ‘”\e[B”‘:history-search-forward

Now you can easily summon any command from the history by typing the command and pressing Up arrow. You might continue pressing Up arrow until you find the command instance you wish to execute again.

Create a free website or blog at WordPress.com.