Better recording of shell commands GOAL: Keep track of the time of shell command execution and do not lose command history. The following solution works well for me on many of my servers. 1. cp /etc/profile /etc/profile.orig 2. Edit /etc/profile 3. diff /etc/profile /etc/profile.orig [root@zaphod root]# diff /etc/profile /etc/profile.orig 32,36c32 < HISTSIZE=1000000000 < HISTFILESIZE=1000000000 < HISTDATE=`date` < < echo "Commands below this line occur after $HISTDATE" >> $HOME/.bash_history --- > HISTSIZE=1000 42c38 < export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTFILESIZE INPUTRC --- > export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC NOTE: /etc/profile is many times called twice, so there are two lines "Commands below this line"... entered into .bash_history. This is the best solution I have found aside from altering the bash source code and recompiling bash.