CentOS系统清空删除系统日志的方法

前端之家收集整理的这篇文章主要介绍了CentOS系统清空删除系统日志的方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使用CentOS系统的时候,经常会遇到系统日志文件非常大的情况,如果直接删除,会导致日志错误,不再生成日志,这时,我们可以使用下面的方法清空日志。

CentOS 6系统

cat/dev/null>/var/log/boot.log
cat/dev/null>/var/log/btmp
cat/dev/null>/var/log/cron
cat/dev/null>/var/log/dmesg
cat/dev/null>/var/log/dracut.log
cat/dev/null>/var/log/lastlog
cat/dev/null>/var/log/maillog
cat/dev/null>/var/log/messages
cat/dev/null>/var/log/secure
cat/dev/null>/var/log/spooler
cat/dev/null>/var/log/tallylog
cat/dev/null>/var/log/wtmp
cat/dev/null>/var/log/yum.log

CentOS 7系统

cat/dev/null>/var/log/boot.log
cat/dev/null>/var/log/btmp
cat/dev/null>/var/log/cron
cat/dev/null>/var/log/dmesg
cat/dev/null>/var/log/firewalld
cat/dev/null>/var/log/grubby
cat/dev/null>/var/log/lastlog
cat/dev/null>/var/log/mail.info
cat/dev/null>/var/log/maillog
cat/dev/null>/var/log/messages
cat/dev/null>/var/log/secure
cat/dev/null>/var/log/spooler
cat/dev/null>/var/log/syslog
cat/dev/null>/var/log/tallylog
cat/dev/null>/var/log/wpa_supplicant.log
cat/dev/null>/var/log/wtmp
cat/dev/null>/var/log/yum.log
原文链接:https://www.f2er.com/centos/375517.html

猜你在找的CentOS相关文章