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
  • 207,228

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