Saturday, May 15, 2010

Increase your Bash History Size

Working with the linux bash shell, the command history could be one of your best friends.
Using the history command (for example joined with a grep) lets you relax your brain and fingers. Sure, even more relaxed is the usage of the reverse-search-history function (Ctrl-R).

To make sure the history's brain isn't to small, you should increase its size. The following lines need to be added to your ~/.bashrc file. It increases the history to the last 10.000 commands, erases previous duplicates and makes sure that the commands are appended (and do no override) on shell exit:

export HISTSIZE=10000
export HISTCONTROL=erasedups
shopt -s histappend