如何让linux的history命令显示时间记录
编辑/etc/bashrc文件,加入如下三行:
HISTFILESIZE=2000
HISTSIZE=2000
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
export HISTTIMEFORMAT
生效:source /etc/bashrc
cat >> /etc/bashrc << EOF
HISTFILESIZE=2000
HISTSIZE=2000
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
export HISTTIMEFORMAT
EOF