批量清空日志
跳到导航
跳到搜索
sudo truncate
#!/bin/bash # 如果sudo # sudo truncate -s 0 /var/log/nginx/access.log # 删除 4月的日志 for loop in `ls | grep hello-wallet_2020-04` do echo > $loop #echo $loop done
echo
#!/bin/bash #cd /data/storage/logs for loop in `ls /data/storage/logs` do echo '' >/data/storage/logs/${loop} done