I have custom PS1 bash prompt which includes command history count. It has work flawlessly for weeks, but today I noticed it's stuck at 2000. When I execute command, it gets to 2001 as it's supposed, but when I close terminal and open it again, it's again 2000. I don't remember doing any changes to terminal configuration. This problem occurs in gnome-terminal and xfce4-terminal as well.

Thank you.

  • 1
    Is it possible your history size is stuck at 2000? See here... askubuntu.com/questions/307541/… – user508889 Jun 2 '16 at 20:39
  • 1
    Seems likely seems the default cap does seem to be 2000. OP: Edit ~/.bashrc and change HISTSIZE and HISTFILESIZE to a have no value. – palmerito0 Jun 2 '16 at 22:52
  • Thank you, this worked. Could you copy your comment into answer so I can mark it as solved? – Michal Polovka Jun 3 '16 at 6:45

Add to your ~/.bashrc:

export HISTFILESIZE=20000
export HISTSIZE=20000

And you'll have 20k as limit.

HISTSIZE is the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.

HISTFILESIZE is the number of lines or commands that (a) are allowed in the history file at startup time of a session, and (b) are stored in the history file at the end of your bash session for use in future sessions. (from here)

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.