Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find directories having size greater than x MB

Tags:

linux

shell

unix

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 ?

like image 480
Sandy Avatar asked Jul 11 '13 16:07

Sandy


People also ask

How do I find files larger than 10mb in size in usr directory?

Syntax of find command to find files bigger than given size in Linux. For example, “-size +4G” makes the find command to search for files greater than 4GB. Here, + sign is denote that look for files greater than or equal to N[Type], like in this case, -size +4G will make find command to look for files bigger than 4GB.

How do I see files larger than 100mb?

Make sure the "Windows (C)" drive is selected, and click in the search field in the upper right corner of the window, then click the "Size" link. 7. Click on "Gigantic (> 128 MB)" in the menu if looking for files of that size or larger.


1 Answers

If I'm interpreting your question right, I think this might be what you want:

cd /home du -sm * | awk '$1 > 1000' 

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...

like image 113
twalberg Avatar answered Sep 28 '22 20:09

twalberg