小编Les*_*Jea的帖子

按大小清除文件内容

考虑是否列出目录中的文件:

drwx--x--x 43 root wheel 4.0K Aug 18 12:52 ..
-rw-------  1 root root  268K Aug 18 04:31 build_locale_databases_log
-rw-------  1 root root  5.2M Aug 18 17:21 access_log
-rw-------  1 root root   85K Aug 18 17:14 cpbackup_transporter.log
-rw-------  1 root root  2.1M Aug 18 05:49 cphulkd.log
-rw-------  1 root root  3.2M Aug 18 17:19 error_log
-rw-------  1 root root  1.7M Aug 18 12:52 license_log
Run Code Online (Sandbox Code Playgroud)

这里我想清除大于的文件内容2Mb。(即)将以下文件的文件大小设置为零字节:

access_log
cphulkd.log
error_log
Run Code Online (Sandbox Code Playgroud)

shell find

2
推荐指数
1
解决办法
2589
查看次数

标签 统计

find ×1

shell ×1