SUSE Conversations


Unlimited Bash History

variia

By: variia

January 22, 2009 10:21 am

Reads:539

Comments:0

Rating:0

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
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Enterprise Linux, Technical Solutions

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS