Sun Nov 1 16:47:29 2020 UTC ()
Properly quote '\;' in example.


(wiz)
diff -r1.90 -r1.91 src/usr.bin/find/find.1

cvs diff -r1.90 -r1.91 src/usr.bin/find/find.1 (switch to unified diff)

--- src/usr.bin/find/find.1 2020/11/01 16:34:02 1.90
+++ src/usr.bin/find/find.1 2020/11/01 16:47:29 1.91
@@ -1,977 +1,977 @@ @@ -1,977 +1,977 @@
1.\" $NetBSD: find.1,v 1.90 2020/11/01 16:34:02 kim Exp $ 1.\" $NetBSD: find.1,v 1.91 2020/11/01 16:47:29 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1993 3.\" Copyright (c) 1990, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to Berkeley by 6.\" This code is derived from software contributed to Berkeley by
7.\" the Institute of Electrical and Electronics Engineers, Inc. 7.\" the Institute of Electrical and Electronics Engineers, Inc.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the 15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution. 16.\" documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors 17.\" 3. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software 18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission. 19.\" without specific prior written permission.
20.\" 20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE. 31.\" SUCH DAMAGE.
32.\" 32.\"
33.\" from: @(#)find.1 8.7 (Berkeley) 5/9/95 33.\" from: @(#)find.1 8.7 (Berkeley) 5/9/95
34.\" 34.\"
35.Dd June 13, 2016 35.Dd June 13, 2016
36.Dt FIND 1 36.Dt FIND 1
37.Os 37.Os
38.Sh NAME 38.Sh NAME
39.Nm find 39.Nm find
40.Nd walk a file hierarchy 40.Nd walk a file hierarchy
41.Sh SYNOPSIS 41.Sh SYNOPSIS
42.Nm 42.Nm
43.Op Fl H | Fl L | Fl P 43.Op Fl H | Fl L | Fl P
44.Op Fl dEhsXx 44.Op Fl dEhsXx
45.Ar file 45.Ar file
46.Op Ar file ... 46.Op Ar file ...
47.Op Ar expression 47.Op Ar expression
48.Nm 48.Nm
49.Op Fl H | Fl L | Fl P 49.Op Fl H | Fl L | Fl P
50.Op Fl dEhsXx 50.Op Fl dEhsXx
51.Fl f Ar file 51.Fl f Ar file
52.Op Ar file ... 52.Op Ar file ...
53.Op Ar expression 53.Op Ar expression
54.Sh DESCRIPTION 54.Sh DESCRIPTION
55.Nm 55.Nm
56recursively descends the directory tree for each 56recursively descends the directory tree for each
57.Ar file 57.Ar file
58listed, evaluating an 58listed, evaluating an
59.Ar expression 59.Ar expression
60(composed of the 60(composed of the
61.Dq primaries 61.Dq primaries
62and 62and
63.Dq operands 63.Dq operands
64listed below) in terms 64listed below) in terms
65of each file in the tree. 65of each file in the tree.
66.Pp 66.Pp
67The options are as follows: 67The options are as follows:
68.Bl -tag -width Ds 68.Bl -tag -width Ds
69.It Fl H 69.It Fl H
70Causes the file information and file type (see 70Causes the file information and file type (see
71.Xr stat 2 ) 71.Xr stat 2 )
72returned for each symbolic link encountered on the command line to be 72returned for each symbolic link encountered on the command line to be
73those of the file referenced by the link, not the link itself. 73those of the file referenced by the link, not the link itself.
74If the referenced file does not exist, the file information and type will 74If the referenced file does not exist, the file information and type will
75be for the link itself. 75be for the link itself.
76File information of all symbolic links not on the command line is that 76File information of all symbolic links not on the command line is that
77of the link itself. 77of the link itself.
78.It Fl L 78.It Fl L
79Causes the file information and file type (see 79Causes the file information and file type (see
80.Xr stat 2 ) 80.Xr stat 2 )
81returned for each symbolic link to be those of the file referenced by the 81returned for each symbolic link to be those of the file referenced by the
82link, not the link itself. 82link, not the link itself.
83If the referenced file does not exist, the file information and type will 83If the referenced file does not exist, the file information and type will
84be for the link itself. 84be for the link itself.
85.It Fl P 85.It Fl P
86Causes the file information and file type (see 86Causes the file information and file type (see
87.Xr stat 2 ) 87.Xr stat 2 )
88returned for each symbolic link to be those of the link itself. 88returned for each symbolic link to be those of the link itself.
89.It Fl d 89.It Fl d
90Causes 90Causes
91.Nm 91.Nm
92to perform a depth-first traversal, i.e., directories 92to perform a depth-first traversal, i.e., directories
93are visited in post-order, and all entries in a directory will be acted 93are visited in post-order, and all entries in a directory will be acted
94on before the directory itself. 94on before the directory itself.
95By default, 95By default,
96.Nm 96.Nm
97visits directories in pre-order, i.e., before their contents. 97visits directories in pre-order, i.e., before their contents.
98Note, the default is 98Note, the default is
99.Em not 99.Em not
100a breadth-first traversal. 100a breadth-first traversal.
101.It Fl E 101.It Fl E
102Causes 102Causes
103.Ar regexp 103.Ar regexp
104arguments to primaries to be interpreted as extended regular 104arguments to primaries to be interpreted as extended regular
105expressions (see 105expressions (see
106.Xr re_format 7 ) . 106.Xr re_format 7 ) .
107.It Fl f 107.It Fl f
108Specifies a file hierarchy for 108Specifies a file hierarchy for
109.Nm 109.Nm
110to traverse. 110to traverse.
111File hierarchies may also be specified as the operands immediately 111File hierarchies may also be specified as the operands immediately
112following the options. 112following the options.
113.It Fl h 113.It Fl h
114Causes the file information and file type (see 114Causes the file information and file type (see
115.Xr stat 2 ) 115.Xr stat 2 )
116returned for each symbolic link to be those of the file referenced by the 116returned for each symbolic link to be those of the file referenced by the
117link, not the link itself. 117link, not the link itself.
118If the referenced file does not exist, the file information and type will 118If the referenced file does not exist, the file information and type will
119be for the link itself. 119be for the link itself.
120.It Fl s 120.It Fl s
121Causes the entries of each directory to be sorted in 121Causes the entries of each directory to be sorted in
122lexicographical order. 122lexicographical order.
123Note that the sorting is done only inside of each directory; 123Note that the sorting is done only inside of each directory;
124files in different directories are not sorted. 124files in different directories are not sorted.
125Therefore, 125Therefore,
126.Sq Li a/b 126.Sq Li a/b
127appears before 127appears before
128.Sq Li a.b , 128.Sq Li a.b ,
129which is different from 129which is different from
130.Dq Li "find ... \&| sort" 130.Dq Li "find ... \&| sort"
131order. 131order.
132.It Fl X 132.It Fl X
133Modifies the output to permit 133Modifies the output to permit
134.Nm 134.Nm
135to be safely used in conjunction with 135to be safely used in conjunction with
136.Xr xargs 1 . 136.Xr xargs 1 .
137If a file name contains any of the delimiting characters used by 137If a file name contains any of the delimiting characters used by
138.Xr xargs 1 , 138.Xr xargs 1 ,
139a diagnostic message is displayed on standard error, and the file 139a diagnostic message is displayed on standard error, and the file
140is skipped. 140is skipped.
141The delimiting characters include single 141The delimiting characters include single
142.Pq Dq \&' 142.Pq Dq \&'
143and double 143and double
144.Pq Dq \&" 144.Pq Dq \&"
145quotes, backslash 145quotes, backslash
146.Pq Dq \e , 146.Pq Dq \e ,
147space, tab, and newline characters. 147space, tab, and newline characters.
148Alternatively, the 148Alternatively, the
149.Ic -print0 149.Ic -print0
150or 150or
151.Ic -printx 151.Ic -printx
152primaries can be used to format the output in a way that 152primaries can be used to format the output in a way that
153.Xr xargs 1 153.Xr xargs 1
154can accept. 154can accept.
155.It Fl x 155.It Fl x
156Restricts the search to the file system containing the 156Restricts the search to the file system containing the
157directory specified. 157directory specified.
158Does not list mount points to other file systems. 158Does not list mount points to other file systems.
159.El 159.El
160.Sh PRIMARIES 160.Sh PRIMARIES
161All primaries which take a numeric argument of 161All primaries which take a numeric argument of
162.Ar n 162.Ar n
163allow the number to be preceded by a plus sign 163allow the number to be preceded by a plus sign
164.Pq Dq \&+ 164.Pq Dq \&+
165or a minus sign 165or a minus sign
166.Pq Dq \- . 166.Pq Dq \- .
167A preceding plus sign means 167A preceding plus sign means
168.Dq more than Ar n , 168.Dq more than Ar n ,
169a preceding minus sign means 169a preceding minus sign means
170.Dq less than Ar n , 170.Dq less than Ar n ,
171and neither means 171and neither means
172.Dq exactly Ar n . 172.Dq exactly Ar n .
173(The argument specified for the 173(The argument specified for the
174.Ic -user 174.Ic -user
175and 175and
176.Ic -group 176.Ic -group
177primaries 177primaries
178are similarly treated if the value is numeric and does not correspond to a 178are similarly treated if the value is numeric and does not correspond to a
179valid user or group name.) 179valid user or group name.)
180.Pp 180.Pp
181For primaries which take a 181For primaries which take a
182.Ar timestamp 182.Ar timestamp
183argument, the argument must be valid input to 183argument, the argument must be valid input to
184.Xr parsedate 3 . 184.Xr parsedate 3 .
185If the argument contains multiple words, enclose the argument in quotes. 185If the argument contains multiple words, enclose the argument in quotes.
186.Pp 186.Pp
187.Bl -tag -width Ds -compact 187.Bl -tag -width Ds -compact
188.It Ic -amin Ar n 188.It Ic -amin Ar n
189True if the difference between the file last access time and the time 189True if the difference between the file last access time and the time
190.Nm 190.Nm
191was started, rounded up to the next full minute, is 191was started, rounded up to the next full minute, is
192.Ar n 192.Ar n
193minutes. 193minutes.
194.Pp 194.Pp
195.It Ic -anewer Ar file 195.It Ic -anewer Ar file
196True if the current file has a more recent last access time than 196True if the current file has a more recent last access time than
197.Ar file . 197.Ar file .
198.Pp 198.Pp
199.It Ic -asince Ar timestamp 199.It Ic -asince Ar timestamp
200True if the file last access time is greater than the specified 200True if the file last access time is greater than the specified
201.Ar timestamp . 201.Ar timestamp .
202.Pp 202.Pp
203.It Ic -atime Ar n 203.It Ic -atime Ar n
204True if the difference between the file last access time and the time 204True if the difference between the file last access time and the time
205.Nm 205.Nm
206was started, rounded up to the next full 24-hour period, is 206was started, rounded up to the next full 24-hour period, is
207.Ar n 207.Ar n
20824-hour periods. 20824-hour periods.
209.Pp 209.Pp
210.It Ic -cmin Ar n 210.It Ic -cmin Ar n
211True if the difference between the time of last change of file status 211True if the difference between the time of last change of file status
212information and the time 212information and the time
213.Nm 213.Nm
214was started, rounded up to the next full minute, is 214was started, rounded up to the next full minute, is
215.Ar n 215.Ar n
216minutes. 216minutes.
217.Pp 217.Pp
218.It Ic -cnewer Ar file 218.It Ic -cnewer Ar file
219True if the current file has a more recent last change time than 219True if the current file has a more recent last change time than
220.Ar file . 220.Ar file .
221.Pp 221.Pp
222.It Ic -csince Ar timestamp 222.It Ic -csince Ar timestamp
223True if the file last status change time is greater than the specified 223True if the file last status change time is greater than the specified
224.Ar timestamp . 224.Ar timestamp .
225.Pp 225.Pp
226.It Ic -ctime Ar n 226.It Ic -ctime Ar n
227True if the difference between the time of last change of file status 227True if the difference between the time of last change of file status
228information and the time 228information and the time
229.Nm 229.Nm
230was started, rounded up to the next full 24-hour period, is 230was started, rounded up to the next full 24-hour period, is
231.Ar n 231.Ar n
23224-hour periods. 23224-hour periods.
233.Pp 233.Pp
234.It Ic -delete 234.It Ic -delete
235Delete found files, symbolic links, and directories. 235Delete found files, symbolic links, and directories.
236Always returns true. 236Always returns true.
237This executes from the current working directory as 237This executes from the current working directory as
238.Nm 238.Nm
239recurses down the tree. 239recurses down the tree.
240To avoid deleting unexpected files, it will ignore any filenames that 240To avoid deleting unexpected files, it will ignore any filenames that
241.Xr fts 3 241.Xr fts 3
242returns that contain a 242returns that contain a
243.Dq / 243.Dq /
244.Xr ( fts 3 244.Xr ( fts 3
245should not return such pathnames). 245should not return such pathnames).
246Depth-first traversal processing is implied by this option. 246Depth-first traversal processing is implied by this option.
247This primary can also be invoked as 247This primary can also be invoked as
248.Ic -rm . 248.Ic -rm .
249.Pp 249.Pp
250.It Ic -empty 250.It Ic -empty
251True if the current file or directory is empty. 251True if the current file or directory is empty.
252.Pp 252.Pp
253.It Ic -exec Ar utility Oo argument ... Oc Ic \&; 253.It Ic -exec Ar utility Oo argument ... Oc Ic \&;
254.It Ic -exec Ar utility Oo argument ... Oc Ic {} Ic \&+ 254.It Ic -exec Ar utility Oo argument ... Oc Ic {} Ic \&+
255Execute the specified 255Execute the specified
256.Ar utility 256.Ar utility
257with the specified arguments. 257with the specified arguments.
258.Pp 258.Pp
259The list of arguments for 259The list of arguments for
260.Ar utility 260.Ar utility
261is terminated by a lone semicolon 261is terminated by a lone semicolon
262.Dq Ic \&; 262.Dq Ic \&;
263or plus 263or plus
264.Dq Ic \&+ 264.Dq Ic \&+
265character as a separate parameter. 265character as a separate parameter.
266The command specified by 266The command specified by
267.Ar utility 267.Ar utility
268will be executed with its current working directory being the directory 268will be executed with its current working directory being the directory
269from which 269from which
270.Nm 270.Nm
271was executed. 271was executed.
272.Pp 272.Pp
273If the list of arguments is terminated by a semicolon 273If the list of arguments is terminated by a semicolon
274.Pq Dq Ic \&; , 274.Pq Dq Ic \&; ,
275then 275then
276.Ar utility 276.Ar utility
277is invoked once per pathname. 277is invoked once per pathname.
278If 278If
279the string 279the string
280.Dq Ic {} 280.Dq Ic {}
281appears one or more times in the utility name or arguments, 281appears one or more times in the utility name or arguments,
282then it is replaced by the pathname of the current file 282then it is replaced by the pathname of the current file
283(but it need not appear, in which case the pathname 283(but it need not appear, in which case the pathname
284will not be passed to 284will not be passed to
285.Ar utility ) . 285.Ar utility ) .
286The semicolon-terminated form of the 286The semicolon-terminated form of the
287.Ic -exec 287.Ic -exec
288primary returns true if and only if 288primary returns true if and only if
289.Ar utility 289.Ar utility
290exits with a zero exit status. 290exits with a zero exit status.
291Note that the semicolon will have to be escaped on the shell command line 291Note that the semicolon will have to be escaped on the shell command line
292in order to be passed as a parameter. 292in order to be passed as a parameter.
293.Pp 293.Pp
294If the list of arguments is terminated by a plus sign 294If the list of arguments is terminated by a plus sign
295.Pq Dq Ic \&+ , 295.Pq Dq Ic \&+ ,
296then the pathnames for which the primary is evaluated are aggregated 296then the pathnames for which the primary is evaluated are aggregated
297into sets, and 297into sets, and
298.Ar utility 298.Ar utility
299will be invoked once per set, similar to 299will be invoked once per set, similar to
300.Xr xargs 1 . 300.Xr xargs 1 .
301In this case the string 301In this case the string
302.Dq Ic {} 302.Dq Ic {}
303must appear, and must appear as the last item in the argument list, 303must appear, and must appear as the last item in the argument list,
304just before the 304just before the
305.Dq Ic \&+ 305.Dq Ic \&+
306parameter, and is replaced by the pathnames of the current set of files. 306parameter, and is replaced by the pathnames of the current set of files.
307Each set is limited to no more than 5,000 pathnames, 307Each set is limited to no more than 5,000 pathnames,
308and is also limited such that the total number of bytes in the argument 308and is also limited such that the total number of bytes in the argument
309list does not exceed 309list does not exceed
310.Dv ARG_MAX . 310.Dv ARG_MAX .
311The plus-terminated form of the 311The plus-terminated form of the
312.Ic -exec 312.Ic -exec
313primary always returns true. 313primary always returns true.
314If the plus-terminated form of the 314If the plus-terminated form of the
315.Ic -exec 315.Ic -exec
316primary results in any invocation of 316primary results in any invocation of
317.Ar utility 317.Ar utility
318exiting with non-zero exit status, then 318exiting with non-zero exit status, then
319.Nm 319.Nm
320will eventually exit with non-zero status as well, 320will eventually exit with non-zero status as well,
321but this does not cause 321but this does not cause
322.Nm 322.Nm
323to exit early. 323to exit early.
324.Pp 324.Pp
325.It Ic -execdir Ar utility Oo argument ... Oc Ic \&; 325.It Ic -execdir Ar utility Oo argument ... Oc Ic \&;
326The 326The
327.Ic -execdir 327.Ic -execdir
328primary is similar to the semicolon-terminated 328primary is similar to the semicolon-terminated
329.Pq Dq Ic \&; 329.Pq Dq Ic \&;
330variant of the 330variant of the
331.Ic -exec 331.Ic -exec
332primary, with the exception that 332primary, with the exception that
333.Ar utility 333.Ar utility
334will be executed from the directory that holds 334will be executed from the directory that holds
335the current file. 335the current file.
336Only the base filename is substituted for the string 336Only the base filename is substituted for the string
337.Dq Ic {} . 337.Dq Ic {} .
338Set aggregation 338Set aggregation
339.Pq Do Ic \&+ Dc termination 339.Pq Do Ic \&+ Dc termination
340is not supported. 340is not supported.
341.Pp 341.Pp
342.It Ic -exit Op Ar status 342.It Ic -exit Op Ar status
343This primary causes 343This primary causes
344.Nm 344.Nm
345to stop traversing the file system and exit immediately, 345to stop traversing the file system and exit immediately,
346with the specified numeric exit status. 346with the specified numeric exit status.
347If the 347If the
348.Ar status 348.Ar status
349value is not specified, then 349value is not specified, then
350.Nm 350.Nm
351will exit with status zero. 351will exit with status zero.
352Note that any preceding primaries will be evaluated and acted upon 352Note that any preceding primaries will be evaluated and acted upon
353before exiting. 353before exiting.
354.Pp 354.Pp
355.It Ic -false 355.It Ic -false
356This primary always evaluates to false. 356This primary always evaluates to false.
357This can be used following a primary that caused the 357This can be used following a primary that caused the
358expression to be true to make the expression to be false. 358expression to be true to make the expression to be false.
359This can be useful after using a 359This can be useful after using a
360.Ic -fprint 360.Ic -fprint
361primary so it can continue to the next expression (using an 361primary so it can continue to the next expression (using an
362.Cm -or 362.Cm -or
363operator, for example). 363operator, for example).
364.Pp 364.Pp
365.It Ic -flags Oo Fl Oc Ns Ar flags 365.It Ic -flags Oo Fl Oc Ns Ar flags
366If 366If
367.Ar flags 367.Ar flags
368are preceded by a dash 368are preceded by a dash
369.Pq Dq Ic \- , 369.Pq Dq Ic \- ,
370this primary evaluates to true 370this primary evaluates to true
371if at least all of the bits in 371if at least all of the bits in
372.Ar flags 372.Ar flags
373are set in the file's flags bits. 373are set in the file's flags bits.
374If 374If
375.Ar flags 375.Ar flags
376are not preceded by a dash, this primary evaluates to true if 376are not preceded by a dash, this primary evaluates to true if
377the bits in 377the bits in
378.Ar flags 378.Ar flags
379exactly match the file's flags bits. 379exactly match the file's flags bits.
380If 380If
381.Ar flags 381.Ar flags
382is 382is
383.Dq none , 383.Dq none ,
384files with no flags bits set are matched. 384files with no flags bits set are matched.
385(See 385(See
386.Xr chflags 1 386.Xr chflags 1
387for more information about file flags.) 387for more information about file flags.)
388.Pp 388.Pp
389.It Ic -follow 389.It Ic -follow
390Follow symbolic links. 390Follow symbolic links.
391.Pp 391.Pp
392.It Ic -fprint Ar filename 392.It Ic -fprint Ar filename
393This primary always evaluates to true. 393This primary always evaluates to true.
394This creates 394This creates
395.Ar filename 395.Ar filename
396or overwrites the file if it already exists. 396or overwrites the file if it already exists.
397The file is created at startup. 397The file is created at startup.
398It writes the pathname of the current file to this file, followed 398It writes the pathname of the current file to this file, followed
399by a newline character. 399by a newline character.
400The file will be empty if no files are matched. 400The file will be empty if no files are matched.
401.Pp 401.Pp
402.It Ic -fstype Ar type 402.It Ic -fstype Ar type
403True if the file is contained in a file system of type 403True if the file is contained in a file system of type
404.Ar type . 404.Ar type .
405The 405The
406.Xr sysctl 8 406.Xr sysctl 8
407command can be used to find out the types of file systems 407command can be used to find out the types of file systems
408that are available on the system: 408that are available on the system:
409.Bd -literal -offset indent 409.Bd -literal -offset indent
410sysctl vfs.generic.fstypes 410sysctl vfs.generic.fstypes
411.Ed 411.Ed
412.Pp 412.Pp
413In addition, there are two pseudo-types, 413In addition, there are two pseudo-types,
414.Dq local 414.Dq local
415and 415and
416.Dq rdonly . 416.Dq rdonly .
417The former matches any file system physically mounted on the system where 417The former matches any file system physically mounted on the system where
418the 418the
419.Nm 419.Nm
420is being executed, and the latter matches any file system which is 420is being executed, and the latter matches any file system which is
421mounted read-only. 421mounted read-only.
422.Pp 422.Pp
423.It Ic -group Ar gname 423.It Ic -group Ar gname
424True if the file belongs to the group 424True if the file belongs to the group
425.Ar gname . 425.Ar gname .
426If 426If
427.Ar gname 427.Ar gname
428is numeric and there is no such group name, then 428is numeric and there is no such group name, then
429.Ar gname 429.Ar gname
430is treated as a group id (and considered a numeric argument). 430is treated as a group id (and considered a numeric argument).
431.Pp 431.Pp
432.It Ic -iname Ar pattern 432.It Ic -iname Ar pattern
433True if the last component of the pathname being examined matches 433True if the last component of the pathname being examined matches
434.Ar pattern 434.Ar pattern
435in a case-insensitive manner. 435in a case-insensitive manner.
436Special shell pattern matching characters 436Special shell pattern matching characters
437.Po 437.Po
438.Dq \&[ , 438.Dq \&[ ,
439.Dq \&] , 439.Dq \&] ,
440.Dq \&* , 440.Dq \&* ,
441and 441and
442.Dq \&? 442.Dq \&?
443.Pc 443.Pc
444may be used as part of 444may be used as part of
445.Ar pattern . 445.Ar pattern .
446These characters may be matched explicitly by escaping them with a 446These characters may be matched explicitly by escaping them with a
447backslash 447backslash
448.Pq Dq \e . 448.Pq Dq \e .
449.Pp 449.Pp
450.It Ic -inum Ar n 450.It Ic -inum Ar n
451True if the file has inode number 451True if the file has inode number
452.Ar n . 452.Ar n .
453.Pp 453.Pp
454.It Ic -iregex Ar regexp 454.It Ic -iregex Ar regexp
455True if the path name of the current file matches the case-insensitive 455True if the path name of the current file matches the case-insensitive
456basic regular expression 456basic regular expression
457.Pq see Xr re_format 7 457.Pq see Xr re_format 7
458.Ar regexp . 458.Ar regexp .
459This is a match on the whole path, not a search for the regular expression 459This is a match on the whole path, not a search for the regular expression
460within the path. 460within the path.
461.Pp 461.Pp
462.It Ic -links Ar n 462.It Ic -links Ar n
463True if the file has 463True if the file has
464.Ar n 464.Ar n
465links. 465links.
466.Pp 466.Pp
467.It Ic -rm 467.It Ic -rm
468This primary is an alias for 468This primary is an alias for
469.Ic -delete . 469.Ic -delete .
470.Pp 470.Pp
471.It Ic -ls 471.It Ic -ls
472This primary always evaluates to true. 472This primary always evaluates to true.
473The following information for the current file is written to standard output: 473The following information for the current file is written to standard output:
474its inode number, size in 512-byte blocks, file permissions, number of hard 474its inode number, size in 512-byte blocks, file permissions, number of hard
475links, owner, group, size in bytes, last modification time, and pathname. 475links, owner, group, size in bytes, last modification time, and pathname.
476If the file is a block or character special file, the major and minor numbers 476If the file is a block or character special file, the major and minor numbers
477will be displayed instead of the size in bytes. 477will be displayed instead of the size in bytes.
478If the file is a symbolic link, the pathname of the linked-to file will be 478If the file is a symbolic link, the pathname of the linked-to file will be
479displayed preceded by 479displayed preceded by
480.Dq -> . 480.Dq -> .
481The format is identical to that produced by 481The format is identical to that produced by
482.Dq ls -dgils . 482.Dq ls -dgils .
483.Pp 483.Pp
484.It Ic -maxdepth Ar depth 484.It Ic -maxdepth Ar depth
485True if the current search depth is less than or equal to what is specified in 485True if the current search depth is less than or equal to what is specified in
486.Ar depth . 486.Ar depth .
487.Pp 487.Pp
488.It Ic -mindepth Ar depth 488.It Ic -mindepth Ar depth
489True if the current search depth is at least what is specified in 489True if the current search depth is at least what is specified in
490.Ar depth . 490.Ar depth .
491.Pp 491.Pp
492.It Ic -mmin Ar n 492.It Ic -mmin Ar n
493True if the difference between the file last modification time and the time 493True if the difference between the file last modification time and the time
494.Nm 494.Nm
495was started, rounded up to the next full minute, is 495was started, rounded up to the next full minute, is
496.Ar n 496.Ar n
497minutes. 497minutes.
498.Pp 498.Pp
499.It Ic -mtime Ar n 499.It Ic -mtime Ar n
500True if the difference between the file last modification time and the time 500True if the difference between the file last modification time and the time
501.Nm 501.Nm
502was started, rounded up to the next full 24-hour period, is 502was started, rounded up to the next full 24-hour period, is
503.Ar n 503.Ar n
50424-hour periods. 50424-hour periods.
505.Pp 505.Pp
506.It Ic -ok Ar utility Oo argument ... Oc Ic \&; 506.It Ic -ok Ar utility Oo argument ... Oc Ic \&;
507The 507The
508.Ic -ok 508.Ic -ok
509primary is similar to the semicolon-terminated 509primary is similar to the semicolon-terminated
510.Pq Dq \&; 510.Pq Dq \&;
511variant of the 511variant of the
512.Ic -exec 512.Ic -exec
513primary, with the exception that 513primary, with the exception that
514.Nm 514.Nm
515requests user affirmation for the execution of 515requests user affirmation for the execution of
516.Ar utility 516.Ar utility
517by printing 517by printing
518a message to the terminal and reading a response. 518a message to the terminal and reading a response.
519If the response is other than 519If the response is other than
520.Dq y , 520.Dq y ,
521the command is not executed and the 521the command is not executed and the
522.Ic -ok 522.Ic -ok
523primary evaluates to false. 523primary evaluates to false.
524Set aggregation 524Set aggregation
525.Pq Do \&+ Dc termination 525.Pq Do \&+ Dc termination
526is not supported. 526is not supported.
527.Pp 527.Pp
528.It Ic -name Ar pattern 528.It Ic -name Ar pattern
529True if the last component of the pathname being examined matches 529True if the last component of the pathname being examined matches
530.Ar pattern . 530.Ar pattern .
531Special shell pattern matching characters 531Special shell pattern matching characters
532.Po 532.Po
533.Dq \&[ , 533.Dq \&[ ,
534.Dq \&] , 534.Dq \&] ,
535.Dq \&* , 535.Dq \&* ,
536and 536and
537.Dq \&? 537.Dq \&?
538.Pc 538.Pc
539may be used as part of 539may be used as part of
540.Ar pattern . 540.Ar pattern .
541These characters may be matched explicitly by escaping them with a 541These characters may be matched explicitly by escaping them with a
542backslash 542backslash
543.Pq Dq \e . 543.Pq Dq \e .
544.Pp 544.Pp
545.It Ic -newer Ar file 545.It Ic -newer Ar file
546True if the current file has a more recent last modification time than 546True if the current file has a more recent last modification time than
547.Ar file . 547.Ar file .
548.Pp 548.Pp
549.It Ic -newerXY Ar reference 549.It Ic -newerXY Ar reference
550For compatibility with Gnu findutils. 550For compatibility with Gnu findutils.
551.Bl -column -offset indent ".Sy findutils" ".Sy equivalent" 551.Bl -column -offset indent ".Sy findutils" ".Sy equivalent"
552.It Sy findutils Ta Sy find 552.It Sy findutils Ta Sy find
553.It Sy option Ta Sy equivalent 553.It Sy option Ta Sy equivalent
554.It -neweraa Ta -anewer 554.It -neweraa Ta -anewer
555.It -newerat Ta -asince 555.It -newerat Ta -asince
556.It -newercc Ta -cnewer 556.It -newercc Ta -cnewer
557.It -newerct Ta -csince 557.It -newerct Ta -csince
558.It -newermm Ta -newer 558.It -newermm Ta -newer
559.It -newermt Ta -since 559.It -newermt Ta -since
560.El 560.El
561.Pp 561.Pp
562Other option variants from findutils are not implemented. 562Other option variants from findutils are not implemented.
563.Pp 563.Pp
564.It Ic -nouser 564.It Ic -nouser
565True if the file belongs to an unknown user. 565True if the file belongs to an unknown user.
566.Pp 566.Pp
567.It Ic -nogroup 567.It Ic -nogroup
568True if the file belongs to an unknown group. 568True if the file belongs to an unknown group.
569.Pp 569.Pp
570.It Ic -path Ar pattern 570.It Ic -path Ar pattern
571True if the pathname being examined matches 571True if the pathname being examined matches
572.Ar pattern . 572.Ar pattern .
573Special shell pattern matching characters 573Special shell pattern matching characters
574.Po 574.Po
575.Dq \&[ , 575.Dq \&[ ,
576.Dq \&] , 576.Dq \&] ,
577.Dq \&* , 577.Dq \&* ,
578and 578and
579.Dq \&? 579.Dq \&?
580.Pc 580.Pc
581may be used as part of 581may be used as part of
582.Ar pattern . 582.Ar pattern .
583These characters may be matched explicitly by escaping them with a 583These characters may be matched explicitly by escaping them with a
584backslash 584backslash
585.Pq Dq \e . 585.Pq Dq \e .
586Slashes 586Slashes
587.Pq Dq / 587.Pq Dq /
588are treated as normal characters and do not have to be 588are treated as normal characters and do not have to be
589matched explicitly. 589matched explicitly.
590.Pp 590.Pp
591.It Ic -perm Oo Fl Oc Ns Ar mode 591.It Ic -perm Oo Fl Oc Ns Ar mode
592The 592The
593.Ar mode 593.Ar mode
594may be either symbolic (see 594may be either symbolic (see
595.Xr chmod 1 ) 595.Xr chmod 1 )
596or an octal number. 596or an octal number.
597If the mode is symbolic, a starting value of zero is assumed and the 597If the mode is symbolic, a starting value of zero is assumed and the
598mode sets or clears permissions without regard to the process' file mode 598mode sets or clears permissions without regard to the process' file mode
599creation mask. 599creation mask.
600If the mode is octal, only bits 07777 600If the mode is octal, only bits 07777
601.Pf ( Dv S_ISUID 601.Pf ( Dv S_ISUID
602| 602|
603.Dv S_ISGID 603.Dv S_ISGID
604| 604|
605.Dv S_ISTXT 605.Dv S_ISTXT
606| 606|
607.Dv S_IRWXU 607.Dv S_IRWXU
608| 608|
609.Dv S_IRWXG 609.Dv S_IRWXG
610| 610|
611.Dv S_IRWXO ) 611.Dv S_IRWXO )
612of the file's mode bits participate 612of the file's mode bits participate
613in the comparison. 613in the comparison.
614If the mode is preceded by a dash 614If the mode is preceded by a dash
615.Pq Dq Ic \- , 615.Pq Dq Ic \- ,
616this primary evaluates to true 616this primary evaluates to true
617if at least all of the bits in the mode are set in the file's mode bits. 617if at least all of the bits in the mode are set in the file's mode bits.
618If the mode is not preceded by a dash, this primary evaluates to true if 618If the mode is not preceded by a dash, this primary evaluates to true if
619the bits in the mode exactly match the file's mode bits. 619the bits in the mode exactly match the file's mode bits.
620Note, the first character of a symbolic mode may not be a dash 620Note, the first character of a symbolic mode may not be a dash
621.Pq Dq Ic \- . 621.Pq Dq Ic \- .
622.Pp 622.Pp
623.It Ic -print 623.It Ic -print
624This primary always evaluates to true. 624This primary always evaluates to true.
625It prints the pathname of the current file to standard output, followed 625It prints the pathname of the current file to standard output, followed
626by a newline character. 626by a newline character.
627If none of 627If none of
628.Ic -delete , 628.Ic -delete ,
629.Ic -exec , 629.Ic -exec ,
630.Ic -execdir , 630.Ic -execdir ,
631.Ic -exit , 631.Ic -exit ,
632.Ic -fprint , 632.Ic -fprint ,
633.Ic -ls , 633.Ic -ls ,
634.Ic -ok , 634.Ic -ok ,
635.Ic -print0 , 635.Ic -print0 ,
636.Ic -printx , 636.Ic -printx ,
637nor 637nor
638.Ic -rm 638.Ic -rm
639is specified, the given expression shall be effectively replaced by 639is specified, the given expression shall be effectively replaced by
640.Cm \&( Ns Ar given\& expression Ns Cm \&) 640.Cm \&( Ns Ar given\& expression Ns Cm \&)
641.Ic -print . 641.Ic -print .
642.Pp 642.Pp
643.It Ic -print0 643.It Ic -print0
644This primary always evaluates to true. 644This primary always evaluates to true.
645It prints the pathname of the current file to standard output, followed 645It prints the pathname of the current file to standard output, followed
646by a NUL character. 646by a NUL character.
647.Pp 647.Pp
648.It Ic -printx 648.It Ic -printx
649This primary always evaluates to true. 649This primary always evaluates to true.
650It prints the pathname of the current file to standard output, 650It prints the pathname of the current file to standard output,
651with each space, tab, newline, backslash, dollar sign, and single, 651with each space, tab, newline, backslash, dollar sign, and single,
652double, or back quotation mark prefixed by a backslash, so the output of 652double, or back quotation mark prefixed by a backslash, so the output of
653.Nm 653.Nm
654can safely be used as input to 654can safely be used as input to
655.Xr xargs 1 . 655.Xr xargs 1 .
656.Pp 656.Pp
657.It Ic -prune 657.It Ic -prune
658This primary always evaluates to true. 658This primary always evaluates to true.
659It causes 659It causes
660.Nm 660.Nm
661to not descend into the current file. 661to not descend into the current file.
662Note, the 662Note, the
663.Ic -prune 663.Ic -prune
664primary has no effect if the 664primary has no effect if the
665.Fl d 665.Fl d
666option was specified. 666option was specified.
667.Pp 667.Pp
668.It Ic -regex Ar regexp 668.It Ic -regex Ar regexp
669True if the path name of the current file matches the case-sensitive 669True if the path name of the current file matches the case-sensitive
670basic regular expression 670basic regular expression
671.Pq see Xr re_format 7 671.Pq see Xr re_format 7
672.Ar regexp . 672.Ar regexp .
673This is a match on the whole path, not a search for the regular expression 673This is a match on the whole path, not a search for the regular expression
674within the path. 674within the path.
675.Pp 675.Pp
676.It Ic -since Ar timestamp 676.It Ic -since Ar timestamp
677True if the file last modification time is more recent than 677True if the file last modification time is more recent than
678.Ar timestamp . 678.Ar timestamp .
679.Pp 679.Pp
680.It Ic -size Ar n Ns Op Cm c 680.It Ic -size Ar n Ns Op Cm c
681True if the file's size, rounded up, in 512-byte blocks is 681True if the file's size, rounded up, in 512-byte blocks is
682.Ar n . 682.Ar n .
683If 683If
684.Ar n 684.Ar n
685is followed by a 685is followed by a
686.Dq Ic c , 686.Dq Ic c ,
687then the primary is true if the file's size is 687then the primary is true if the file's size is
688.Ar n 688.Ar n
689bytes. 689bytes.
690.Pp 690.Pp
691.It Ic -type Ar t 691.It Ic -type Ar t
692True if the file is of the specified type. 692True if the file is of the specified type.
693Possible file types are as follows: 693Possible file types are as follows:
694.Pp 694.Pp
695.Bl -tag -width flag -offset indent -compact 695.Bl -tag -width flag -offset indent -compact
696.It Cm b 696.It Cm b
697block special 697block special
698.It Cm c 698.It Cm c
699character special 699character special
700.It Cm d 700.It Cm d
701directory 701directory
702.It Cm f 702.It Cm f
703regular file 703regular file
704.It Cm l 704.It Cm l
705symbolic link 705symbolic link
706.It Cm p 706.It Cm p
707FIFO 707FIFO
708.It Cm s 708.It Cm s
709socket 709socket
710.It Cm W 710.It Cm W
711whiteout 711whiteout
712.It Cm w 712.It Cm w
713whiteout 713whiteout
714.El 714.El
715.Pp 715.Pp
716.It Ic -user Ar username 716.It Ic -user Ar username
717True if the file belongs to the user 717True if the file belongs to the user
718.Ar username . 718.Ar username .
719If 719If
720.Ar username 720.Ar username
721is numeric and there is no such user on the system, then 721is numeric and there is no such user on the system, then
722.Ar username 722.Ar username
723is treated as a user id (and considered a numeric argument). 723is treated as a user id (and considered a numeric argument).
724.Pp 724.Pp
725.It Ic -xdev 725.It Ic -xdev
726This primary always evaluates to true. 726This primary always evaluates to true.
727It causes find not to descend past directories that have a different 727It causes find not to descend past directories that have a different
728device ID 728device ID
729.Va ( st_dev , 729.Va ( st_dev ,
730see 730see
731.Xr stat 2 731.Xr stat 2
732S5.6.2 [POSIX.1]). 732S5.6.2 [POSIX.1]).
733.El 733.El
734.Sh OPERATORS 734.Sh OPERATORS
735The primaries may be combined using the following operators. 735The primaries may be combined using the following operators.
736The operators are listed in order of decreasing precedence. 736The operators are listed in order of decreasing precedence.
737.Bl -tag -width (expression) 737.Bl -tag -width (expression)
738.It Cm \&( Ar expression Cm \&) 738.It Cm \&( Ar expression Cm \&)
739This evaluates to true if the parenthesized expression evaluates to 739This evaluates to true if the parenthesized expression evaluates to
740true. 740true.
741.It Cm \&! Ar expression 741.It Cm \&! Ar expression
742.It Cm -not Ar expression 742.It Cm -not Ar expression
743This is the unary 743This is the unary
744.Tn NOT 744.Tn NOT
745operator. 745operator.
746It evaluates to true if the expression is false. 746It evaluates to true if the expression is false.
747.It Ar expression Cm -and Ar expression 747.It Ar expression Cm -and Ar expression
748.It Ar expression expression 748.It Ar expression expression
749The 749The
750.Cm -and 750.Cm -and
751operator is the logical 751operator is the logical
752.Tn AND 752.Tn AND
753operator. 753operator.
754As it is implied by the juxtaposition of two expressions it does not 754As it is implied by the juxtaposition of two expressions it does not
755have to be specified. 755have to be specified.
756The expression evaluates to true if both expressions are true. 756The expression evaluates to true if both expressions are true.
757The second expression is not evaluated if the first expression is false. 757The second expression is not evaluated if the first expression is false.
758.It Ar expression Cm -or Ar expression 758.It Ar expression Cm -or Ar expression
759The 759The
760.Cm -or 760.Cm -or
761operator is the logical 761operator is the logical
762.Tn OR 762.Tn OR
763operator. 763operator.
764The expression evaluates to true if either the first or the second expression 764The expression evaluates to true if either the first or the second expression
765is true. 765is true.
766The second expression is not evaluated if the first expression is true. 766The second expression is not evaluated if the first expression is true.
767.El 767.El
768.Pp 768.Pp
769All operands and primaries must be separate arguments to 769All operands and primaries must be separate arguments to
770.Nm . 770.Nm .
771Primaries which themselves take arguments expect each argument 771Primaries which themselves take arguments expect each argument
772to be a separate argument to 772to be a separate argument to
773.Nm . 773.Nm .
774.Sh EXIT STATUS 774.Sh EXIT STATUS
775The 775The
776.Nm 776.Nm
777utility normally exits 0 on success, and exits with 1 under certain 777utility normally exits 0 on success, and exits with 1 under certain
778internal error conditions. 778internal error conditions.
779If any invocations of 779If any invocations of
780.Dq Ic -exec Ar ... Ic \&+ 780.Dq Ic -exec Ar ... Ic \&+
781primaries return non-zero exit-status, then 781primaries return non-zero exit-status, then
782.Nm 782.Nm
783will do so as well. 783will do so as well.
784.Sh EXAMPLES 784.Sh EXAMPLES
785The following examples are shown as given to the shell: 785The following examples are shown as given to the shell:
786.Bl -tag -width findx 786.Bl -tag -width findx
787.It Li "find / \e! -name \*q*.c\*q \-print" 787.It Li "find / \e! -name \*q*.c\*q \-print"
788Print out a list of all the files whose names do not end in 788Print out a list of all the files whose names do not end in
789.Dq \&.c . 789.Dq \&.c .
790.It Li "find / \-newer ttt \-user wnj \-print" 790.It Li "find / \-newer ttt \-user wnj \-print"
791Print out a list of all the files owned by user 791Print out a list of all the files owned by user
792.Dq wnj 792.Dq wnj
793that are newer than the file 793that are newer than the file
794.Dq ttt . 794.Dq ttt .
795.It Li "find . \-type f \-mmin \-30 \-print \-or \-mindepth 1 \-prune" 795.It Li "find . \-type f \-mmin \-30 \-print \-or \-mindepth 1 \-prune"
796Print out a list of all the files in the current directory that are 796Print out a list of all the files in the current directory that are
797newer than 30 minutes. 797newer than 30 minutes.
798.It Li "find . \-type f \-atime +10 \-mindepth 2 \-print" 798.It Li "find . \-type f \-atime +10 \-mindepth 2 \-print"
799Print out a list of all the files in any sub-directories that have not 799Print out a list of all the files in any sub-directories that have not
800been accessed in the past ten days. 800been accessed in the past ten days.
801.It Li "find . \-mtime +90 \-exec rm \-i {} + \-or \-mindepth 1 \-prune" 801.It Li "find . \-mtime +90 \-exec rm \-i {} + \-or \-mindepth 1 \-prune"
802Interactively remove all of the files in the current directory that have 802Interactively remove all of the files in the current directory that have
803not been modified in 90 days. 803not been modified in 90 days.
804.It Li "find . \-type f \-mtime +90 \-ok mv {} {}.old \e;" 804.It Li "find . \-type f \-mtime +90 \-ok mv {} {}.old \e;"
805Interactively rename all of the files in the current directory and all 805Interactively rename all of the files in the current directory and all
806sub-directories that have not been modified in 90 days. 806sub-directories that have not been modified in 90 days.
807.It Li "find / \e! \e( \-newer ttt \-user wnj \e) \-print" 807.It Li "find / \e! \e( \-newer ttt \-user wnj \e) \-print"
808Print out a list of all the files which are not both newer than 808Print out a list of all the files which are not both newer than
809.Dq ttt 809.Dq ttt
810and owned by 810and owned by
811.Dq wnj . 811.Dq wnj .
812.It Li "find / \e( \-newer ttt \-or \-user wnj \e) \-print" 812.It Li "find / \e( \-newer ttt \-or \-user wnj \e) \-print"
813Print out a list of all the files that are either owned by 813Print out a list of all the files that are either owned by
814.Dq wnj 814.Dq wnj
815or that are newer than 815or that are newer than
816.Dq ttt . 816.Dq ttt .
817.It Li "find / \e( \-newer ttt \-or \-user wnj \e) \-exit 1" 817.It Li "find / \e( \-newer ttt \-or \-user wnj \e) \-exit 1"
818Return immediately with a value of 1 if any files are found that are either 818Return immediately with a value of 1 if any files are found that are either
819owned by 819owned by
820.Dq wnj 820.Dq wnj
821or that are newer than 821or that are newer than
822.Dq ttt , 822.Dq ttt ,
823but do not print them. 823but do not print them.
824.It Li "find / \e( \-newer ttt \-or \-user wnj \e) \-ls \-exit 1" 824.It Li "find / \e( \-newer ttt \-or \-user wnj \e) \-ls \-exit 1"
825Same as above, but list the first file matching the criteria before exiting 825Same as above, but list the first file matching the criteria before exiting
826with a value of 1. 826with a value of 1.
827.It Li "find . \-type f \-exec sh \-c 'file=\*[q]$1\*[q]; ...;' - {} \;" 827.It Li "find . \-type f \-exec sh \-c 'file=\*[q]$1\*[q]; ...;' - {} \e;"
828Perform an arbitrarily complex shell command for every file. 828Perform an arbitrarily complex shell command for every file.
829.El 829.El
830.Sh SEE ALSO 830.Sh SEE ALSO
831.Xr chflags 1 , 831.Xr chflags 1 ,
832.Xr chmod 1 , 832.Xr chmod 1 ,
833.Xr locate 1 , 833.Xr locate 1 ,
834.Xr xargs 1 , 834.Xr xargs 1 ,
835.Xr stat 2 , 835.Xr stat 2 ,
836.Xr fts 3 , 836.Xr fts 3 ,
837.Xr getgrent 3 , 837.Xr getgrent 3 ,
838.Xr getpwent 3 , 838.Xr getpwent 3 ,
839.Xr strmode 3 , 839.Xr strmode 3 ,
840.Xr re_format 7 , 840.Xr re_format 7 ,
841.Xr symlink 7 , 841.Xr symlink 7 ,
842.Xr sysctl 8 842.Xr sysctl 8
843.Sh STANDARDS 843.Sh STANDARDS
844The 844The
845.Nm 845.Nm
846utility syntax is a superset of the syntax specified by the 846utility syntax is a superset of the syntax specified by the
847.St -p1003.2 847.St -p1003.2
848standard. 848standard.
849.Pp 849.Pp
850The options, the 850The options, the
851.Ic -amin , 851.Ic -amin ,
852.Ic -anewer , 852.Ic -anewer ,
853.Ic -asince , 853.Ic -asince ,
854.Ic -cmin , 854.Ic -cmin ,
855.Ic -cnewer , 855.Ic -cnewer ,
856.Ic -csince , 856.Ic -csince ,
857.Ic -delete , 857.Ic -delete ,
858.Ic -empty , 858.Ic -empty ,
859.Ic -execdir , 859.Ic -execdir ,
860.Ic -follow , 860.Ic -follow ,
861.Ic -fstype , 861.Ic -fstype ,
862.Ic -iname , 862.Ic -iname ,
863.Ic -inum , 863.Ic -inum ,
864.Ic -iregex , 864.Ic -iregex ,
865.Ic -links , 865.Ic -links ,
866.Ic -ls , 866.Ic -ls ,
867.Ic -maxdepth , 867.Ic -maxdepth ,
868.Ic -mindepth , 868.Ic -mindepth ,
869.Ic -mmin , 869.Ic -mmin ,
870.Ic -path , 870.Ic -path ,
871.Ic -print0 , 871.Ic -print0 ,
872.Ic -printx , 872.Ic -printx ,
873.Ic -regex , 873.Ic -regex ,
874.Ic -rm , 874.Ic -rm ,
875and 875and
876.Ic -since 876.Ic -since
877primaries, and the 877primaries, and the
878.Ic -not 878.Ic -not
879operator are extensions to 879operator are extensions to
880.St -p1003.2 . 880.St -p1003.2 .
881.Pp 881.Pp
882Historically, the 882Historically, the
883.Fl d , 883.Fl d ,
884.Fl h , 884.Fl h ,
885and 885and
886.Fl x 886.Fl x
887options were implemented using the primaries 887options were implemented using the primaries
888.Dq Ic -depth , 888.Dq Ic -depth ,
889.Dq Ic -follow , 889.Dq Ic -follow ,
890and 890and
891.Dq Ic -xdev . 891.Dq Ic -xdev .
892These primaries always evaluated to true, and always 892These primaries always evaluated to true, and always
893took effect when the 893took effect when the
894.Ar expression 894.Ar expression
895was parsed, before the file system traversal began. 895was parsed, before the file system traversal began.
896As a result, some legal expressions could be confusing. 896As a result, some legal expressions could be confusing.
897For example, in the expression 897For example, in the expression
898.Dq Ic -print Ic -or Ic -depth , 898.Dq Ic -print Ic -or Ic -depth ,
899.Ic -print 899.Ic -print
900always evaluates to true, so the standard meaning of 900always evaluates to true, so the standard meaning of
901.Ic -or 901.Ic -or
902implies that 902implies that
903.Ic -depth 903.Ic -depth
904would never be evaluated, but that is not what happens; 904would never be evaluated, but that is not what happens;
905in fact, 905in fact,
906.Ic -depth 906.Ic -depth
907takes effect immediately, without testing whether 907takes effect immediately, without testing whether
908.Ic -print 908.Ic -print
909returns true or false. 909returns true or false.
910.Pp 910.Pp
911Historically, the operator 911Historically, the operator
912.Dq Ic -or 912.Dq Ic -or
913was implemented as 913was implemented as
914.Dq Ic -o , 914.Dq Ic -o ,
915and the operator 915and the operator
916.Dq Ic -and 916.Dq Ic -and
917was implemented as 917was implemented as
918.Dq Ic -a . 918.Dq Ic -a .
919.Pp 919.Pp
920Historic implementations of the 920Historic implementations of the
921.Dq Ic -exec 921.Dq Ic -exec
922and 922and
923.Dq Ic -ok 923.Dq Ic -ok
924primaries did not replace the string 924primaries did not replace the string
925.Dq Ic {} 925.Dq Ic {}
926in the utility name or the 926in the utility name or the
927utility arguments if it did not appear as a separate argument. 927utility arguments if it did not appear as a separate argument.
928This version replaces it no matter where in the utility name or arguments 928This version replaces it no matter where in the utility name or arguments
929it appears. 929it appears.
930.Pp 930.Pp
931Support for 931Support for
932.Dq Ic -exec Ar ... Ic \&+ 932.Dq Ic -exec Ar ... Ic \&+
933is consistent with 933is consistent with
934.Em IEEE PASC Interpretation 1003.2 #210 , 934.Em IEEE PASC Interpretation 1003.2 #210 ,
935though the feature originated in 935though the feature originated in
936.Tn SVR4 . 936.Tn SVR4 .
937.Pp 937.Pp
938The 938The
939.Ic -delete 939.Ic -delete
940primary does not interact well with other options that cause the file system 940primary does not interact well with other options that cause the file system
941tree traversal options to be changed. 941tree traversal options to be changed.
942.Sh HISTORY 942.Sh HISTORY
943A much simpler 943A much simpler
944.Nm 944.Nm
945command appeared in First Edition AT&T Unix. 945command appeared in First Edition AT&T Unix.
946The syntax had become similar to the present version by 946The syntax had become similar to the present version by
947the time of the Fifth Edition. 947the time of the Fifth Edition.
948.Sh BUGS 948.Sh BUGS
949The special characters used by 949The special characters used by
950.Nm 950.Nm
951are also special characters to many shell programs. 951are also special characters to many shell programs.
952In particular, the characters 952In particular, the characters
953.Dq \&* , 953.Dq \&* ,
954.Dq \&[ , 954.Dq \&[ ,
955.Dq \&] , 955.Dq \&] ,
956.Dq \&? , 956.Dq \&? ,
957.Dq \&( , 957.Dq \&( ,
958.Dq \&) , 958.Dq \&) ,
959.Dq \&! , 959.Dq \&! ,
960.Dq \e , 960.Dq \e ,
961and 961and
962.Dq \&; 962.Dq \&;
963may have to be escaped from the shell. 963may have to be escaped from the shell.
964.Pp 964.Pp
965As there is no delimiter separating options and file names or file 965As there is no delimiter separating options and file names or file
966names and the 966names and the
967.Ar expression , 967.Ar expression ,
968it is difficult to specify files named 968it is difficult to specify files named
969.Dq -xdev 969.Dq -xdev
970or 970or
971.Dq \&! . 971.Dq \&! .
972These problems are handled by the 972These problems are handled by the
973.Fl f 973.Fl f
974option and the 974option and the
975.Xr getopt 3 975.Xr getopt 3
976.Dq -- 976.Dq --
977construct. 977construct.