Home‎ > ‎

find -exec rm "No such file" error

posted Oct 18, 2011, 7:10 AM by Allen Gattis
Ever tried to use "find -exec rm -rf" If so, chances are you've gotten an error like "find: foo/bar: No such file or directory". This is because the rm command is deleting sub directories that find expects to still be there.

Add the -depth command so that 'rm' is executed on the greatest depth files first. See find for the details.
Comments