OSX Terminal no longer save my commands in history
Based on this question and answer the following should work:


Disable ~/.profile and ~/.bash:profile by renaming it:

mv ~/.bash_profile ~/off.bash_profile
mv ~/.profile ~/off.profile

Create a new file ~/.bash_logout with the content shell_session_update

echo "shell_session_update" &gt; ~/.bash_logout

Enter killall Terminal
Open Terminal and enable ~/.profile and ~/.bash_profile by renaming it:

mv ~/off.bash_profile ~/.bash_profile
mv ~/off.profile ~/.profile

Enter killall Terminal
Open Terminal and check the behavior now. Remember to always enter exit now before closing a Terminal window or quitting Terminal.