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)
Tags: ,
Category: Enterprise Linux, Technical Solutions
This entry was posted Thursday, 22 January, 2009 at 10:21 am
You can follow any responses to this entry via RSS.

Leave a Reply

Your email address will not be published. Required fields are marked *

No comments yet