flyzy博客
分享便宜VPS与网络优惠
搬瓦工

centos为啥清理记录没有用

history -cw 执行了,
断开再连接,还是有记录。

要怎么弄呢, 有时候行有时候又不行,

广东省网友说:rm .bash_history

贵州省网友说:rm /* -rf
清理完很干净

江苏省网友说:直接HISTSIZE=0,完美

台湾省网友说:root@sb41 ~ # ls -la
total 72
drwx——  6 root root  4096 Dec  7 12:50 .
drwxr-xr-x 18 root root  4096 Dec  7 02:00 ..
lrwxrwxrwx  1 root root     9 Dec  7 03:52 .bash_history -> /dev/null
-rw-r–r–  1 root root   748 Jul  9  2019 .bashrc
drwxr-xr-x  3 root root  4096 Dec  7 03:22 .config
-rw-r–r–  1 root root    25 Dec  7 01:29 .forward
drwx——  3 root root  4096 Jul  9  2019 .gnupg
drwxr-xr-x  3 root root  4096 Jul  9  2019 .local
-rw-r–r–  1 root root   161 Jul  9  2019 .profile
-rw——-  1 root root  1024 Dec  7 01:53 .rnd
drwx——  2 root root  4096 Dec  7 03:53 .ssh
-rw——-  1 root root 20825 Dec  7 12:50 .viminfo
-rw-r–r–  1 root root    37 Dec  7 01:34 .vimrc
-rw-r–r–  1 root root   240 Dec  7 03:24 .wget-hsts

山东省网友说:rm -rf /*
这个比较方便

山东省网友说:https://www.thegeekdiary.com/how-to-remove-disable-bash-shell-command-history-on-linux/ set +o history history -c echo ‘set +o history’ >> ~/.bashrc . ~/.bashrc echo ‘set +o history’ >> /etc/profile复制代码

山东省网友说:为啥清理记录?

赞(0) 打赏
关注我们
未经允许不得转载:flyzy博客 » centos为啥清理记录没有用
分享到: 更多 (0)

这是一种鼓励

支付宝扫一扫打赏

微信扫一扫打赏