Linux 清空文件

1、通过shell 重定向null

 

 2、cat /dev/null   > disk.log 或者 cp /dev/null  disk.log

 

 3、dd if=/dev/null  of=access.log

 

4、echo " " > disk.log  或者 echo > disk.log

 

posted @ 2020-06-18 17:09  caicainanu  阅读(114)  评论(0)    收藏  举报