随笔-开发环境-HISTORY设置
编辑~/.bashrc新增如下配置:
export HISTCONTROL=ignoreboth:erasedups
export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
export HISTSIZE=50000
export HISTCONTROL=ignoreboth:erasedups
: 合并重复的命令,ignoredups 去除连续重复的命令,要消除整个命令历史中的重复命令,把 HISTCONTROL设置成 erasedups。参考:https://qastack.cn/unix/48713/how-can-i-remove-duplicates-in-my-bash-history-preserving-order
加入时间戳等信息:
export HISTTIMEFORMAT="%F %T `whoami` at `who am i | awk '{print $NF}'` "
本文来自博客园,作者:LiYanbin,转载请注明原文链接:https://www.cnblogs.com/stellar-liyanbin/p/18637260