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.
Notice the distinction between file: on disk - and list: in memory.
Stack Overflow上有一个很有意思的答案: https://stackoverflow.com/a/19454838
一开始答主以一个非常完整的、详细的答案来回答的,结果有人评论说太长了,可以总结一下,后来答主把答案分成了简版和详版。这里引用一下简版答案:
大概意思: