history -a(增加)
history -w(覆盖)
history -r (读取)
history -c(清除)
.bashrc的设定:
export HISTSIZE=1000000
export HISTFILESIZE=1000000
alias h="history"
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.
就是说HISTSIZE是bash seesion显示的最大条数,HISTFIESIZE是文件保存的最大条数。