History命令添加时间戳永久生效
临时生效:
[root@localhost ~]# HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S"
[root@localhost ~]# export HISTTIMEFORMAT
[root@localhost ~]# history
永久生效
[root@localhost ~]# cat ~/.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S"
[root@localhost ~]#
[root@localhost ~]# source ~/.bashrc
[root@localhost ~]# history
博主github地址:https://github.com/bazingafraser/cv
本文章为Bazingafraser作者原创,转载请注明出处,违权必究:http://www.cnblogs.com/bazingafraser/
posted on 2018-09-29 15:38 Bazingafraser 阅读(261) 评论(0) 编辑 收藏 举报