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?
2Is your home directory on a read-only AMI or ephemeral storage, and not local SSD or EBS volume?– paradroidSep 11, 2014 at 15:24
touch .bash_history did create the file. Which would indicate it is not read only. Correct?– Steve WallSep 11, 2014 at 17:18
There could be many reasons.
For example, you are using a different shell (not bash). You can check/change your shell using
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. Sep 11, 2014 at 20:19