Kev++

受够了蹩脚软件/网站(Tired of crappy software/website)!

介绍bash的history功能

,


打开shell时,会从$HISTFILE中读取到shell history
关闭shell时,会把shell history写入$HISTFILE


使用history命令
# 输出最近10条shell history
history 10
# 清空当前shell history
history -c
# 把当前shell history保存到$HISTFILE中
history -w
# 从$HISTFILE中读取并追加到当前shell history中
history -r

设置env变量
# 忽略与上一次重复的命令
# 忽略首字母为空格的命令
HISTCONTROL=ignoredups:ignorespace
# 设置shell history最大条数
HISTSIZE=1000
# 设置$HISTFILE最大行数
HISTFILESIZE=2000

设置shell选项
# 关闭shell时,追加而不覆盖$HISTFILE
shopt -s histappend

APT常用命令vaccum firefox sqlite3

Write a comment

New comments have been disabled for this post.