diff options
author | kn <kn@cvs.openbsd.org> | 2019-08-23 12:48:15 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2019-08-23 12:48:15 +0000 |
commit | 407a11d95c4c5398943d5aca048195e65e5d6fe2 (patch) | |
tree | c30f7bff3f9918afd4b03abc35f7d752a4b43909 | |
parent | 18725cd1c3e10d1caa8c9a6d4c469a200cdef206 (diff) |
Use -delete in EXAMPLES
-delete is part of POSIX since 2001 and tedu added support for it in 2012,
-print0 however never made it into any standard, so replace this less
portable idiom with its more concise built-in counterpart.
Both -print0 as well as xargs(1) -0 explain and reference each other and
CAVEATS goes into detail with problematic file names, so no information
is lost by replacing this particular example.
While here, make the -exec example rm(1) multiple files at once.
Feedback from claudio tb
Input and OK millert
-rw-r--r-- | usr.bin/find/find.1 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index a930b4edefc..fb8385291f7 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: find.1,v 1.96 2018/12/06 17:45:14 tedu Exp $ +.\" $OpenBSD: find.1,v 1.97 2019/08/23 12:48:14 kn Exp $ .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -31,7 +31,7 @@ .\" .\" from: @(#)find.1 8.1 (Berkeley) 6/6/93 .\" -.Dd $Mdocdate: December 6 2018 $ +.Dd $Mdocdate: August 23 2019 $ .Dt FIND 1 .Os .Sh NAME @@ -581,9 +581,9 @@ ending in a dot and single digit, but skip directory 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;" +.Dl "$ find . \e( -name \e*.jpg -o -name \e*.gif \e) -exec rm {} +" 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 , |