开发者社区> 问答> 正文

如何让Bash不记录操作历史

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

展开
收起
a123456678 2016-06-16 11:16:02 2151 0
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
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载