2

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.

muru
  • 197,895
  • 55
  • 485
  • 740
  • 1
    Is it possible your history size is stuck at 2000? See here... http://askubuntu.com/questions/307541/how-to-change-history-size-for-ever –  Jun 02 '16 at 20:39
  • 2
    Seems likely seems the default cap does seem to be 2000. OP: Edit ~/.bashrc and change HISTSIZE and HISTFILESIZE to a have no value. – carreter Jun 02 '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 03 '16 at 06:45

1 Answers1

5

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)

Putnik
  • 176