2008-06-13 Stepan Kasal * doc/find.texi (Cleaning Up): Move the note about -depth up. diff --git a/doc/find.texi b/doc/find.texi index 9b7ee99..f68d96b 100644 --- a/doc/find.texi +++ b/doc/find.texi @@ -3865,10 +3865,18 @@ when an update requires a merge: find . -name '.#*' -print0 | xargs -0r rm -f @end example -The command above works, but the following is safer: +If your @code{find} command removes directories, you may find that +you get a spurious error message when @code{find} tries to recurse +into a directory that has now been removed. Using the @samp{-depth} +option will normally resolve this problem. + address@hidden What does the following sentence mean? Why is -delete safer? --kasal address@hidden The command above works, but the following is safer: + +It is also possible to use the @samp{-delete} action: @example -find . -name '.#*' -depth -delete +find . -depth -name '.#*' -delete @end example @c Idea from Franc,ois Pinard. @@ -3881,11 +3889,6 @@ which shell you use). find /tmp -depth -user "$LOGNAME" -type f -delete @end example -If your @code{find} command removes directories, you may find that -you get a spurious error message when @code{find} tries to recurse -into a directory that has now been removed. Using the @samp{-depth} -option will normally resolve this problem. - @c Idea from Noah Friedman. To remove old Emacs backup and auto-save files, you can use a command like the following. It is especially important in this case to use