linux下定期删除日志:
运用linux下的while true循环,加上echo "" > ***.log 完成
while :; do
#echo "" > nohup.out
# ls "dir" -lR |grep -v ^d|awk '{print $9}' |tr -s '\n' > ./list.txt
# echo "text"| tee $(find $(pwd) -name "*.out") > /dev/null
# echo "text"| tee -a $(cat ./list.txt) > /dev/null
echo $(date +%F%n%T)| tee $(find $(pwd) -name "*.out") > /dev/null # 输入内容替换为“”
# find $(pwd) -name "*.out"
echo $(date +%F%n%T)
echo "log clear end"
sleep 5s
done
标签:Linux,tee,echo,pwd,清空,日志,null,find,out
From: https://www.cnblogs.com/iron141/p/16812268.html