加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 在/ home /中查找大型文件(> 100 MB)以进行“清理”

发布时间:2020-12-13 18:29:06 所属栏目:Linux 来源:网络整理
导读:如何在/ home /中找到大型文件( 100 MB)进行“清理”? 这是Centos 6.x.我尝试了一些命令,但它们没有用. 解决方法 Find有它自己的-delete选项 find /home -type f -size +100M -delete 应该做你想做的事.请注意放置-delete选项的位置 Warnings: Don’t forge
如何在/ home /中找到大型文件(> 100 MB)进行“清理”?

这是Centos 6.x.我尝试了一些命令,但它们没有用.

解决方法

Find有它自己的-delete选项
find /home -type f -size +100M -delete

应该做你想做的事.请注意放置-delete选项的位置

Warnings: Don’t forget that the find command line is evaluated
as an expression,so putting -delete first will make find try to
delete everything below the starting points you specified.

如果你想在使用它之前测试它,那么你需要添加-depth,因为-delete暗示它.

find /home -type f -size +100M -depth

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读