破洛洛手机网
当前位置: 首页 > 服务器 > Linux > 正文

Linux下清除系统日志的方法

作者:佚名 来源:网络整理 2015-8-5

   代码如下:

  #!/bin/sh

  cat /dev/null > /var/log/syslog

  cat /dev/null > /var/adm/sylog

  cat /dev/null > /var/log/wtmp

  cat /dev/null > /var/log/maillog

  cat /dev/null > /var/log/messages

  cat /dev/null > /var/log/openwebmail.log

  cat /dev/null > /var/log/maillog

  cat /dev/null > /var/log/secure

  cat /dev/null > /var/log/httpd/error_log

  cat /dev/null > /var/log/httpd/ssl_error_log

  cat /dev/null > /var/log/httpd/ssl_request_log

  cat /dev/null > /var/log/httpd/ssl_access_log

推荐阅读