The -depth option is completely broken in GNU find 4.1 Here is a minimal example that will illustrate the bug: run mkdir /tmp/foo ; echo Blah > /tmp/foo/bar ; find /tmp/foo -depth -empty and the program will respond find: /tmp/foo: Not a directory this is evidently bogus. I have submitted a bug-report to the FSF about this, but since the latest version of findutils dates from 1994, it is rather dubious that anyone will ever look into it. I have written a (trivial) patch of my own that will correct the problem: it is available at ftp://quatramaran.ens.fr/pub/madore/misc/findutils-depthbug/findutils-4.1-depthbug.patch furthermore, there is a source and (Intel) binary RPM that includes this fix: ftp://quatramaran.ens.fr/pub/madore/misc/findutils-depthbug/findutils-4.1-34.1.src.rpm ftp://quatramaran.ens.fr/pub/madore/misc/findutils-depthbug/findutils-4.1-34.1.i386.rpm
Created attachment 1167 [details] Trivial patch that solves the bug
fixed for 7.0.