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.

3
  • 1
    Is it possible your history size is stuck at 2000? See here... askubuntu.com/questions/307541/…
    – user508889
    Jun 2, 2016 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 2, 2016 at 22:52
  • Thank you, this worked. Could you copy your comment into answer so I can mark it as solved? Jun 3, 2016 at 6:45

1 Answer 1

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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .