开发者社区 问答 正文

如何让Bash不记录操作历史

终端运行每个命令都会记录下来,每次运行以后,运行history都能看到运行记录。
能不能不要让终端记录的操作。

展开
收起
a123456678 2016-06-16 11:16:02 2312 分享 版权
1 条回答
写回答
取消 提交回答
  • if grep "unset HISTFILE" /etc/profile >/dev/null 2>&1
            then
                find / -iname '*.bash_history' -type f -exec rm -f {} \;
            else
                echo "unset HISTFILE" >> /etc/profile
                find / -iname '*.bash_history' -type f -exec rm -f {} \;
            fi
    2019-07-17 19:40:36
    赞同 展开评论
问答分类:
问答标签:
问答地址: