Thursday, November 25, 2010

eternal bash history

I like to archive every command line prompt I ever type. For this I add the following two lines to my .bashrc:


#eternal bash history
export HISTTIMEFORMAT="%y/%m/%d %H:%M:%S "
PROMPT_COMMAND='history 1 >> ${HOME}/.bash_eternal_history'


Those lines are pretty self explanatory.

If bash supported something like zsh's PREEXEC, I could also archive the time it took to execute each command - that would be cool.

1 comment: