export HISTTIMEFORMAT="`whoami`@%F %T "
或者写入/etc/profile, 然后source /etc/profile
下面就是输出的格式:
434 root@2014-03-29 17:27:03 history
435 root@2014-03-29 17:27:11 export HISTTIMEFORMAT="`whoami`@%F %T "
本文介绍如何在Bash shell中设置历史命令的时间戳格式,通过修改环境变量HISTTIMEFORMAT来实现更友好的时间显示。示例展示了具体配置方法及效果。
export HISTTIMEFORMAT="`whoami`@%F %T "
或者写入/etc/profile, 然后source /etc/profile
下面就是输出的格式:
434 root@2014-03-29 17:27:03 history
435 root@2014-03-29 17:27:11 export HISTTIMEFORMAT="`whoami`@%F %T "
6282

被折叠的 条评论
为什么被折叠?