HISTFILESIZE
HISTFILESIZE is a shell variable used by Bash to limit the number of lines stored in the history file, typically ~/.bash_history. It is distinct from HISTSIZE, which controls how many commands are kept in memory for the current session. When the history file is saved, Bash ensures it contains no more than HISTFILESIZE lines; if the file would exceed the limit, the oldest entries are discarded to fit the limit. The variable does not limit in-session history; users can still access recent commands through the in-memory history up to HISTSIZE. If the histappend option is enabled, new lines are appended to the history file rather than overwriting it; the file remains bounded by HISTFILESIZE.
To configure, set in your shell startup files, for example: export HISTFILESIZE=10000. You can also set HISTSIZE
In multi-session environments, the effective history may include entries from prior sessions up to the limit