woodongwong / notes

4 stars 0 forks source link

Bash环境变量HISTSIZE与HISTFILESIZE的区别 #24

Open woodongwong opened 5 years ago

woodongwong commented 5 years ago

Stack Overflow上有一个很有意思的答案: https://stackoverflow.com/a/19454838

一开始答主以一个非常完整的、详细的答案来回答的,结果有人评论说太长了,可以总结一下,后来答主把答案分成了简版和详版。这里引用一下简版答案:

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.

大概意思: