如何让history命令显示日期和时间

linux默认执行history是不显示日期和时间的

但是,我们想知道命令是什么时候执行的

于是执行:

vi /etc/profile

在该文件中加入命令

export 'HISTTIMEFORMAT="%F %T" ' >> /etc/profile

执行命令使其生效

source /etc/profile

之后我们再执行history

猜你喜欢

转载自blog.csdn.net/dabao87/article/details/83858491