Linux中禁用命令历史记录

关闭history记录功能

  • set +o history

打开history记录功能

  • set -o history

清空记录

  • history -c 记录被清空,重新登录后恢复。
  • rm -f $HOME/.bash_history 删除记录文件,清空历史。

临时不记录

  • 在执行的命令前添加空格。例如: history
原文地址:https://www.cnblogs.com/zhuxiaoxi/p/8214706.html