删除linux系统日志

将下面的脚本保持为 rm-log.sh

#!/bin/sh  
 
# to empty all the logs in a directory
for i in /var/log/*; 
  do cat /dev/null > $i; 
done

在命令行执行:

chmod +x ./rm-log.sh
sudo ./rm-log.sh

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

请拖动滑块 *