http://qs1969.pair.com?node_id=24620


in reply to RE: RE: What's eating all your disk space?
in thread What's eating all your disk space?

I thought about building the sorting but decided against it ("One tool does one thing"). I figure that I'll leave sorting to 'sort'. ;-)

As to 'df' walking the tree twice, I looked at that as well. In my tests, it looked like the results were cached somewhere, and thus 'df -sk . *' is quite fast. A prior version of the script did something horrible along the lines of: 'du -sk *|perl -e `$sum=du -sk .` while(<>) {....}, so this is an improvement already.

This is pretty quick, and I use it on 40GB raid arrays. :-)