Unix command to list all directories larger than 10mb

Is this possible, and what would the command be?


du is the easiest way. Grab the directories of interest with perl.

du -m . | perl -ne '@l = split();print "@l\n" if $l[0]>=10'

du -k /<root-of-interest> | sort -n 

Then look at the tail for the large directories. You want all that are report greater than 10000.


Do like this:

find {/path/to/directory} -type f -size +{file-size-in-kb}k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'

Remember to don´t put the {}'s.

In your case do like this:

find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'