From http://lpetr.org/blog/archives/preserve-bash-history
It’s actually fairly straightforward to preserve the history. Open up your ~/.bash_profile configuration file in an editor of your choice such as nano. Once you have it open, add these lines at the end: