Unlimited Bash History | SUSE Communities

Unlimited Bash History


The shell history is a very useful tool for system administrators perhaps for any other user as well. I found on some custom systems that I need unlimited history to actually track what was happening on the machine for its lifetime particularly for the root account.

The default settings in bash to remember are 500 lines and 500 commands, I reckon that’s very small and after this your history gets truncated.

The solution is to make it very large through the shell profile settings:

geeko:~ # vi .bashrc
declare -x HISTFILESIZE=1000000000
declare -x HISTSIZE=1000000

It’s technically not unlimited, just large enough to keep you running for a while 🙂 But in reality you have very little chance to fill this history…

Activate it by logout/login or just source it for your current session:

geeko:~ # source .bashrc
(Visited 1 times, 1 visits today)

Leave a Reply

Your email address will not be published.

No comments yet