Dave Nebinger wrote:
I need some help with listing home directories that are greater than i
given size. I have tried
find /home -type d -size +50000k
and
find /home -type d -size +50000k -iname "*"
Both without much success...
find will not calculate folder sizes (as you've already seen).
You'll need to use du and then filter the output. Perchance something like:
du | grep -v "\/" | sort -n
This should give you the directories (in the current dir) w/o the sub
directories but include the calculated size of the directory sorted
numerically on the output.
You can do something similar with a pair of recursive du:
du -S ./ | grep -E "^[5-9][0-9]{4}[^0-9]"
du -S ./ | grep -E "^[0-9]{6,}"
The first command will give you a listing of all directories with
50000-99999k of files. The second gives you all directories with
100000k+ of files. Neither size includes subdirectories, so if you want
sub-directories included in the math, just take out the '-S' option.
-Richard
--
[email protected] mailing list