使用echo命令清空日志文件
echo -n "" > /server/tomcat/logs/catalina.out ==>要加上"-n"参数,默认情况下会"
",也就是回车符
du -h /server/tomcat/logs/catalina.out
使用echo命令清空tomcat日志文件测试实例:
[root@zdz ~]# echo -n "" > /server/tomcat/logs/catalina.out
[root@zdz ~]# du -h /server/tomcat/logs/catalina.out
0 /server/tomcat/logs/catalina.out
------------------------------
本人微信公众帐号: 心禅道(xinchandao)
本人微信公众帐号:双色球预测合买(ssqyuce)