Linux系统怎么删除历史操作命令
发布时间:2016-12-06 14:20
相关话题
入侵时目标如果是linux服务器,看切忌清理痕迹的时候别忘记history命令的记录哦,那么Linux系统怎么删除历史操作命令呢?今天小编与大家分享下Linux系统删除历史操作命令的解决方法,有兴趣的朋友不妨了解下。
Linux系统删除历史操作命令方法
登录CentOS6.4操作系统,这里小编需要提醒大家的是,后续操作的删除命令只会删除当前用户的操作命令,并不会影响其他用户。

在提示符后输入命令history,就可以查看到当前用户的历史操作命令。图中所示的是目前系统保存到root用户输入的377条命令。

在提示符下输入命令history -c就可以删除历史操作命令。再用history命令查看,发现历史操作命令已删除。

如果希望系统不再保存历史操作命令,就必须更改配置文件目录下的配置文件profile。首先使用vi编辑器打开该文件。

找到HISTSIZE这个值,默认情况下历史命令将保存1000条,可以将该值改为0,然后保存并退出,最后重启系统使得配置文件生效。

6重启完成后,再次使用命令history查看,发现系统已不再记录命令。

Linux系统怎么删除历史操作命令的评论条评论