Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My bash shell is clearing its history automatically and I am unable to figure out whats wrong.

I have looked at the bashrc file and these are the settings


Can some one suggest what exactly is going wrong?

share|improve this question

migrated from Sep 14 '12 at 8:14

This question came from our site for professional and enthusiast programmers.

When is bash shell clearing its history automatically? On logout? – Lex Sep 14 '12 at 6:09

It's can be rewrited by different sessions
Try to add it:

  shopt -s histappend
  PROMPT_COMMAND='history -a'
share|improve this answer

Your ~/.bash_history may not be writable

share|improve this answer
It has permissions set to read and write. I dont think thats the issue – user1670541 Sep 14 '12 at 6:06

It's can be this line in bash init files:


Or this variable is undefined.

Or in file bash_logout maybe remove the history-file.

See also:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.