I have MacOSX but this should be *NIX-generic.
In my computer at work, my bash shell remembers history from previous sessions, even if I just opened a new terminal.
In my computer at home, this doesn't happen.
I have the same OS in both machines and I don't have any history related setting in .bash_profile.
How could I set this up on my home computer so it remembers history across sessions?


Please ensure that you are running bash at home. This can be done with the following

echo $SHELL 


echo $0


ps -p $$

Output on method one should be something like


Method 2 should output should be


Method 3 should output some process with BASH in it.

If you are truly running bash there should be a .bash_history file under your home folder. Your user account might not be setup properly if you are not receiving a history.

Some environmental options to consider


To check these settings use:


To update use:

export HISTSIZE=9000

If you are not using BASH as your shell you can mod your account (if you have privs) by:

usermod -s /bin/bash <username>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.