Setup bash_eternal_history

In order to setup eternal bash history for all users:

vim /etc/bashrc

insert

if [ "$BASH" ]; then
export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "("$ORIGINAL_USER")" "COMMAND: " "$(history 1 | cut -c8-)" >> /var/log/bash_eternal_history'
alias ehistory='cat /var/log/bash_eternal_history'
readonly PROMPT_COMMAND
readonly HISTSIZE
readonly HISTFILE
readonly HOME
readonly HISTIGNORE
readonly HISTCONTROL
fi

Then as root run the commands:

# touch /var/log/bash_eternal_history
# chmod 777 /var/log/bash_eternal_history
# chattr +a /var/log/bash_eternal_history

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....