All you need to do is set
HISTSIZE in your bash profile (
~/.bash_profile). You can leave
HISTFILESIZE unset. This will configure both the in-memory history and the file-based history.
# Saves 10 million lines in memory and in the bash history file.
Explanation, additional information.
The problem is HISTFILESIZE only sets the maximum history stored to file when you startup a session. HISTSIZE is what determines how many lines get saved at the end of a session. If HISTFILESIZE is larger than your HISTSIZE, you'll never see more than your HISTSIZE because the file is getting overwritten with HISTSIZE commands (unless you set history to append, but that is a separate topic: look up
histappend in shell builtin commands for that).
This is the reason you're seeing no effect. With HISTSIZE at default (probably 500) your history file is always getting overwritten by the most recent $HISTSIZE commands. Anything older (which could potentially grow the list past $HISTSIZE) is wiped away.
For most cases there's no need to set HISTFILESIZE independently of HISTSIZE.
HISTSIZE determines how many lines will get written to the history file. The command list is truncated upon exit, before writing to the history file, keeping N most recent lines. By default, this list overwrites the history file.
HISTFILESIZE determines how large the history file (in lines) can be. The file gets truncated upon startup, keeping N most recent lines. In addition, the history file is potentially truncated whenever HISTFILESIZE is set.
Finally, although it appears to be undocumented, BASH sets HISTFILESIZE based on HISTSIZE if HISTSIZE is set during startup. I've tried this out on macOS, and a few varieties of Ubuntu, and the behavior is consistent. If you set HISTSIZE in a launch file (not via the command line by any means), HISTFILESIZE will be set to match. (Try it yourself: set HISTSIZE to some arbitarily large value in .bash_profile, exit and start a new terminal, then
echo $HISTSIZE $HISTFILESIZE and you'll find them matching.)
As a result, there's no reason to touch HISTFILESIZE unless you want different values, and the uses cases to have different values are rare (and typically involve more history customization settings to get something useful).