禁用历史的Linux [英] Disable history in Linux

查看:241
本文介绍了禁用历史的Linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要禁用Linux环境中的历史我已经执行以下命令:

To disable a history in Linux environment I've executed the following commands:

export HISTFILESIZE=0
export HISTSIZE=0
unset HISTFILE

是这样的命令组合不够或者我也必须执行历史-c 或其他什么东西?

就当我重新启动服务器或这样的命令需要被一次又一次地重新启动后,执行该保留的历史甚至停用?

Will this keep history disabled even when I reboot a server or such commands need to be executed after reboot again and again?

推荐答案

就在这个命令添加到这可能是一个bash启动文件 / etc / profile文件〜/ .bash_profile中〜/ .bash_login文件〜/ .profile文件〜/ .bashrc中具体取决于定制的bash你的目标范围和发行。请参阅 INVOCATION 的bash手册的部分(男人庆典)。

Just add this command to a bash startup file which could be /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile, or ~/.bashrc depending your target scope and distro that customizes bash. See the INVOCATION section of bash's manual (man bash).

shopt -u -o history

或者

set +o history

这将禁用历史。

虽然你必须清除历史记录一次:

Although you have to clear your history once:

history -c

和也删除〜/ .bash_history的文件。

这篇关于禁用历史的Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆