关闭history记录功能
set +o history
打开history记录功能
set -o history
清空记录
history -c记录被清空,重新登录后恢复。rm -f $HOME/.bash_history删除记录文件,清空历史。
临时不记录
- 在执行的命令前添加空格。例如:
history
set +o historyset -o historyhistory -c 记录被清空,重新登录后恢复。rm -f $HOME/.bash_history 删除记录文件,清空历史。history原文:https://www.cnblogs.com/zhuxiaoxi/p/8214706.html