aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/find/find.1
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2001-09-04 16:09:01 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2001-09-04 16:09:01 +0000
commit7fd5ee41e3fc0035fa23ee3022cd53fa8cb0c53d (patch)
treeae4ff4c89d3d1e609ef173e35ec5a7635f8c2dc6 /usr.bin/find/find.1
parentdb2077f8e1407c2f1b9b32c0221503298ae85ddd (diff)
downloadsrc-7fd5ee41e3fc0035fa23ee3022cd53fa8cb0c53d.tar.gz
src-7fd5ee41e3fc0035fa23ee3022cd53fa8cb0c53d.zip
The implementation of -flags was broken and did not match the (poorly)
documented behavior. Only a certain set of file flags were recognized, and "no" flags did not match files that have corresponding flags bits turned off. Fix and extend the -flags functionality as follows: : -flags [-|+]<flags>,<notflags> : The flags are specified using symbolic names (see chflags(1)). : Those with the "no" prefix (except "nodump") are said to be : <notflags>. Flags in <flags> are checked to be set, and flags in : <notflags> are checked to be not set. Note that this is different : from -perm, which only allows the user to specify mode bits that : are set. : : If flags are preceded by a dash (``-''), this primary evaluates : to true if at least all of the bits in <flags> and none of the bits : in <notflags> are set in the file's flags bits. If flags are pre- : ceded by a plus (``+''), this primary evaluates to true if any of : the bits in <flags> is set in the file's flags bits, or any of the : bits in <notflags> is not set in the file's flags bits. Otherwise, : this primary evaluates to true if the bits in <flags> exactly match : the file's flags bits, and none of the <flags> bits match those of : <notflags>. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=82972
Diffstat (limited to 'usr.bin/find/find.1')
-rw-r--r--usr.bin/find/find.185
1 files changed, 65 insertions, 20 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1
index 99d496720985..5945d58e7bee 100644
--- a/usr.bin/find/find.1
+++ b/usr.bin/find/find.1
@@ -243,20 +243,50 @@ The filename substituted for
the string
.Dq Li {}
is not qualified.
-.It Ic -flags Op Fl Ns Ar flags
-This primary evaluates to true if exactly those flags of the file are
-set which are also set using the specified
-.Ar flags
-(if these are not preceded by a dash
-.Pq Dq Li - ,
-or if they match the specified flags (if these are preceded by a dash).
-The
-.Ar flags
-are specified using symbolic names (see
+.It Ic -flags Oo Cm - Ns | Ns Cm + Oc Ns Ar flags , Ns Ar notflags
+The flags are specified using symbolic names (see
.Xr chflags 1 ) .
+Those with the
+.Qq Li no
+prefix (except
+.Qq Li nodump )
+are said to be
+.Ar notflags .
+Flags in
+.Ar flags
+are checked to be set, and flags in
+.Ar notflags
+are checked to be not set.
Note that this is different from
.Ic -perm ,
-which only allows you to specify flags which are set.
+which only allows the user to specify mode bits that are set.
+.Pp
+If flags are preceded by a dash
+.Pq Dq Li - ,
+this primary evaluates to true
+if at least all of the bits in
+.Ar flags
+and none of the bits in
+.Ar notflags
+are set in the file's flags bits.
+If flags are preceded by a plus
+.Pq Dq Li + ,
+this primary evaluates to true
+if any of the bits in
+.Ar flags
+is set in the file's flags bits,
+or any of the bits in
+.Ar notflags
+is not set in the file's flags bits.
+Otherwise,
+this primary evaluates to true
+if the bits in
+.Ar flags
+exactly match the file's flags bits,
+and none of the
+.Ar flags
+bits match those of
+.Ar notflags .
.It Ic -fstype Ar type
True if the file is contained in a file system of type
.Ar type .
@@ -428,29 +458,44 @@ Slashes
.Pq Dq Li /
are treated as normal characters and do not have to be
matched explicitly.
-.It Ic -perm Oo Fl Oc Ns Ar mode
+.It Ic -perm Oo Cm - Ns | Ns Cm + Oc Ns Ar mode
The
.Ar mode
may be either symbolic (see
.Xr chmod 1 )
or an octal number.
-If the mode is symbolic, a starting value of zero is assumed and the
-mode sets or clears permissions without regard to the process' file mode
+If the
+.Ar mode
+is symbolic, a starting value of zero is assumed and the
+.Ar mode
+sets or clears permissions without regard to the process' file mode
creation mask.
-If the mode is octal, only bits 07777
+If the
+.Ar mode
+is octal, only bits 07777
.Pq Dv S_ISUID | S_ISGID | S_ISTXT | S_IRWXU | S_IRWXG | S_IRWXO
of the file's mode bits participate
in the comparison.
-If the mode is preceded by a dash
+If the
+.Ar mode
+is preceded by a dash
.Pq Dq Li - ,
this primary evaluates to true
-if at least all of the bits in the mode are set in the file's mode bits.
-If the mode is preceded by a plus
+if at least all of the bits in the
+.Ar mode
+are set in the file's mode bits.
+If the
+.Ar mode
+is preceded by a plus
.Pq Dq Li + ,
this primary evaluates to true
-if any of the bits in the mode are set in the file's mode bits.
+if any of the bits in the
+.Ar mode
+are set in the file's mode bits.
Otherwise, this primary evaluates to true if
-the bits in the mode exactly match the file's mode bits.
+the bits in the
+.Ar mode
+exactly match the file's mode bits.
Note, the first character of a symbolic mode may not be a dash
.Pq Dq Li - .
.It Ic -print