Leif160519的blog Leif160519的blog

——————

目录
linux中快速清空文件内容的几种方法
/  

linux中快速清空文件内容的几种方法

$ : > filename 
$ > filename 
$ echo "" > filename  会多一行回车
$ echo > filename  会多一行回车
$ cat /dev/null > filename
$ truncate -s 0 filename

若系统提示权限不足,则执行sudo chmod 777 filename(文件名)


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题linux中快速清空文件内容的几种方法
作  者Leif160519
出  处https://github.icu/articles/2019/08/22/1566462777139.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!