We support -delete since the following and I see no reason to prefer the
current examples for the very same reasons tedu already outlined:
find.c revision 1.21
date: 2017/01/03 21:31:16; author: tedu; state: Exp; lines: +10 -4;
add -delete option which can simplify the common case of wanting to
delete
lots of files without the arcane -exec or error prone xargs.
code from freebsd.
ok millert
CAVEATS even goes into detail wrt. removing special files, so no
information seems to be lost with this diff.
Feedback? OK?
Index: find.1
===================================================================
RCS file: /cvs/src/usr.bin/find/find.1,v
retrieving revision 1.96
diff -u -p -r1.96 find.1
--- find.1 6 Dec 2018 17:45:14 -0000 1.96
+++ find.1 22 Aug 2019 10:31:14 -0000
@@ -581,9 +581,7 @@ ending in a dot and single digit, but sk
Find and remove all *.jpg and *.gif files under the current working
directory:
.Pp
-.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} \e;"
-or
-.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -print0 | xargs -0r rm"
+.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -delete"
.Sh SEE ALSO
.Xr chflags 1 ,
.Xr chmod 1 ,