vim ~/.bashrc 或者 ~/.bash_profile 或者 获取root权限修改vim /etc/profile最后添加export HISTTIMEFORMAT="%F %T "(注意有两个空格)保存后关闭xshell窗口,重新打开执行history命令