1.设置环境变量 打开命令终端,编辑.bashrc文件中,修改HISTSIZE和HISTFILESIZE都为0 sudo nano ~/.bashrc for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=0 HISTFILESIZE=0 2.生效 source ~/.bashrc 3.验证 cat ./bash_history