linux能立即永久清除所有用户历史的脚本?
1.如果用下面的脚本test(假设只有2个用户):
#!/bin/bash
sudo echo > /root/.bash_history;
sudo echo > /home/linuxuser/.bash_history;
然后再
sudo bash test
再重启
但这样无效.
2.如果用下面的脚本
#!/bin/bash
history -c;
history -w;
然后再
sudo bash test
或者
bash test
没有反映或效果
3.如果用下面脚本:
sudo history -c
sudo history -w
反映:
bash: history: command not found