If you use Terminal and are having issues with losing your bash history, then you might want to try this hint.
Open Terminal and type the following command:
sudo chown [username] .bash_history
Type your password when prompted.
That it’s. Now when you close and re-open Terminal your bash history should be saved.