Working in AWS I created an instance of Ubuntu 14.04 and noticed the history was not preserved between login sessions. Further investigation showed the .bash_history file did not exist. Why was a .bash_history not created?

  • 2
    Is your home directory on a read-only AMI or ephemeral storage, and not local SSD or EBS volume?
    – paradroid
    Commented Sep 11, 2014 at 15:24
  • touch .bash_history did create the file. Which would indicate it is not read only. Correct?
    – Steve Wall
    Commented Sep 11, 2014 at 17:18

1 Answer 1


There could be many reasons.

For example, you are using a different shell (not bash). You can check/change your shell using chsh command.

If you are using bash, then here are some ways to disable history in bash you may want to check and re-enable: https://stackoverflow.com/questions/18663078/disable-history-in-linux For example, make sure HISTFILE is set, not empty.

The other reason I could think of is that your home directly does not have proper permissions to create the history file.

  • Unfortunately those suggestions didn't seem to be the problem. I verified I was in bash via "ps". I was able to manually create a .bash_history. And an "env | grep HIST" came up empty.
    – Steve Wall
    Commented Sep 11, 2014 at 20:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .