git: 2ba859e1996a - stable/14 - find: Add a warning about -delete.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 17 Jan 2024 18:28:35 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=2ba859e1996a59a7ee9bed6871556c8f9fa8c57a
commit 2ba859e1996a59a7ee9bed6871556c8f9fa8c57a
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-12-21 23:41:05 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-01-17 18:28:22 +0000
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
(cherry picked from commit 45438f9c8b5b91ebf5606b4a98e891559913d25b)
---
usr.bin/find/find.1 | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1
index 5f559a12ec50..afa4c7ab8215 100644
--- a/usr.bin/find/find.1
+++ b/usr.bin/find/find.1
@@ -30,7 +30,7 @@
.\"
.\" @(#)find.1 8.7 (Berkeley) 5/9/95
.\"
-.Dd January 23, 2023
+.Dd December 22, 2023
.Dt FIND 1
.Os
.Sh NAME
@@ -349,6 +349,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