Jump to content

Find: recursive removal of directories errors

From FVue

Problem

When I try to do a recursive removal of directories, e.g.:

find . -type d -name .svn -exec rm -rf {} \;

I get these errors:

find: ./all/lib/.svn: No such file or directory
find: ./all/.svn: No such file or directory
find: ./log/.svn: No such file or directory

Solution

Use the -prune option:

find . -type d -name .svn -exec rm -rf {} \; -prune

Journal

20060827

Tried option -ignore_readdir_race, but it doesn't help.