The thing that I use find for most commonly is to perform a hierarchical grep, i.e
find . -exec grep -Hn regex \{\} \;
How would you do that with the du | grep combo?
find . -exec grep -Hn regex \{\} \;
How would you do that with the du | grep combo?
This will also be faster, because you fork less.
du -a will need to do a stat to get the file size, which is comparatively expensive; I don't think find will (not sure)?
Yes, those stat() calls can be very slow in aggregate on a large tree, especially from HDD (due to seeking) or network filesystem, if the stat information isn't already in cache.
Im not sure how one can do \0 separator with du, plan9's du(1) doesn't list such option.