1.修改添加/etc/profile内容

cat <<EOF >> /etc/profile           ##优化history记录历史
export HISTTIMEFORMAT="%F %T\`who -u am i 2>/dev/null| awk '{print \$NF}'|sed -e 's/[()]//g'\` \`whoami\` "
EOF

2.展示效果

id 日期 时间 ip 用户 命令

优化history记录信息

 

相关文章:

  • 2021-08-07
  • 2021-09-15
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2021-11-08
  • 2021-11-03
  • 2021-05-12
相关资源
相似解决方案