在工作完,或者某些大佬做完X事之后,想要清除自己留下的历史记录,那么就可以选择执行以下命令来清除所有历史记录。(不要去做坏事,天网恢恢疏而不漏,仅建议用于清除自己的服务器历史记录)
echo > /var/log/wtmp
echo > /var/log/btmp
echo>/var/log/lastlog
echo > /var/log/secure
echo > /var/log/messages
echo>/var/log/syslog
echo>/var/log/xferlog
echo>/var/log/auth.log
echo>/var/log/user.log
cat /dev/null > /var/adm/sylog
cat /dev/null > /var/log/maillog
cat /dev/null > /var/log/openwebmail.log
cat /dev/null > /var/log/mail.info
echo>/var/run/utmp
echo > ~/.bash_history
history -c
echo > .bash_history
history -cw