.bash_history does not exist

5,218

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.

Share:
5,218

Related videos on Youtube

Steve Wall
Author by

Steve Wall

It's a good day when I get to be a geek! Technology has always interested me and the fact I get paid to do it is just an added bonus. I'm competent in areas for enterprise architecture, cloud architecture, and hands on implementation. During my career, I've had the opportunity play many roles including development, architecture, system administration, operations and technical management. For most of my career I've been a consultant. Recently I've been working on Infrastructure-as-Code (IaC) to create VMs and install Cloud Foundry on the major IaaS providers - vSphere, GCP, Azure, AWS. And helping large enterprises implement those solutions. In addition to the build out of PaaS infrastructure, I consult with large enterprise organizations regarding microservices architecture from a holistic perspective as well as the inner working of a given microservice. Addressing various Enterprise concerns such as security, availability, performance, zero down time deployments, etc...

Updated on September 18, 2022

Comments

  • Steve Wall
    Steve Wall over 1 year

    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?

    • Naidim
      Naidim over 9 years
      Is your home directory on a read-only AMI or ephemeral storage, and not local SSD or EBS volume?
    • Steve Wall
      Steve Wall over 9 years
      touch .bash_history did create the file. Which would indicate it is not read only. Correct?
  • Steve Wall
    Steve Wall over 9 years
    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.