diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2023-12-21 23:41:05 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2023-12-21 23:41:16 +0000 |
commit | 45438f9c8b5b91ebf5606b4a98e891559913d25b (patch) | |
tree | beccff1ac01b249b13ce1683e395255739ac2011 | |
parent | dc0b4094abf6784bf1a9492c2fea3fb91116b014 (diff) | |
download | src-45438f9c8b5b91ebf5606b4a98e891559913d25b.tar.gz src-45438f9c8b5b91ebf5606b4a98e891559913d25b.zip |
find: Add a warning about -delete.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: pauamma_gundo.com
Differential Revision: https://reviews.freebsd.org/D43162
-rw-r--r-- | usr.bin/find/find.1 | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index 80cb175c550d..de16b012ce4d 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 23, 2023 +.Dd December 22, 2023 .Dt FIND 1 .Os .Sh NAME @@ -347,6 +347,22 @@ The .Ic -delete primary will fail to delete a directory if it is not empty. Following symlinks is incompatible with this option. +.Pp +.Em WARNING : +The +.Ic -delete +primary will immediately attempt to delete the current path when +evaluated. +Be mindful of its place in the expression; as a general rule, it +should almost always come last. +If in doubt, try running with +.Ic -print +in place of +.Ic -delete +first. +See +.Sx OPERATORS +below for additional information on the order of evaluation. .It Ic -depth Always true; same as the non-portable |