在linux系统中,如何清除访问日志、登陆日志及曾使用过的命令呢?
用以下的shell脚本来实现:
复制代码代码示例:
#!/usr/bin/bash
#edit www.jbxue.com echo > /var/log/syslog echo > /var/log/messages echo > /var/log/httpd/access_log echo > /var/log/httpd/error_log echo > /var/log/xferlog echo > /var/log/secure echo > /var/log/auth.log echo > /var/log/user.log echo > /var/log/wtmp echo > /var/log/lastlog echo > /var/log/btmp echo > /var/run/utmp history -c
代码说明: |