查找大小大于x MB的目录 [英] find directories having size greater than x MB
本文介绍了查找大小大于x MB的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以找到仅具有大于x MB的大小的目录.假设我想在/home下找到所有只有大于1000MB且只有1个maxdepth的目录,如何在中找到它?
Is it possible to find the directories only having size large than x MB. Suppose, I want to find all the directories only whose size is large than 1000MB with only 1 maxdepth under /home, how to find it in ?
推荐答案
如果我正确地解释了您的问题,我认为这可能是您想要的:
If I'm interpreting your question right, I think this might be what you want:
cd /home
du -sm * | awk '$1 > 1000'
这将显示/home
中包含1000MB以上的所有目录.如果您的 du
版本不支持 -m
,则可以使用 du -sk
并调整 awk
而不是寻找超过1,000,000KB的位...
This will show all directories in /home
that contain more than 1000MB. If your version of du
doesn't support -m
, you can use du -sk
and adjust the awk
bit to look for more than 1,000,000KB instead...
这篇关于查找大小大于x MB的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文