Web Hosting Talk







View Full Version : du -h --max-depth=1 but showing xxx space?


universal2001
10-12-2002, 04:54 AM
I know this shows up how much each directory is taking
du -h --max-depth=1

Does anyone know how the command to list directories that consume a certain about of space? like for example...

List directories that take up more than 50mb, 100mb, etc?

chuckt101
10-12-2002, 10:14 AM
You can pipe it through sort, but that only takes care of the #, not the unit. For example, it will list 100 meg higher than 50 gig.

I don't know of any commands that will only display a certain range of numbers. Try using REGEX searching ;)

goodW
10-12-2002, 11:24 AM
Originally posted by universal2001
List directories that take up more than 50mb, 100mb, etc?

A little bit crazy ;) but works!!!
du -h -m --max-depth=1 | awk '$1>50 {print}'

universal2001
10-13-2002, 11:37 AM
THANKS!@ works perfectly goodW..