xref: /freebsd/usr.bin/find/find.1 (revision b4ede68c21c6c0277bc283c2bda35f3136e836b6)
158540776STim J. Robbins.\" Copyright (c) 1990, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
59b50d902SRodney W. Grimes.\" the Institute of Electrical and Electronics Engineers, Inc.
69b50d902SRodney W. Grimes.\"
79b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
89b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
99b50d902SRodney W. Grimes.\" are met:
109b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
119b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
129b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
139b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
149b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
15fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
169b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
179b50d902SRodney W. Grimes.\"    without specific prior written permission.
189b50d902SRodney W. Grimes.\"
199b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
209b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
219b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
229b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
239b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
249b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
259b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
269b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
279b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
289b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
299b50d902SRodney W. Grimes.\" SUCH DAMAGE.
309b50d902SRodney W. Grimes.\"
31*b4ede68cSThomas Eberhardt.Dd November 23, 2024
329b50d902SRodney W. Grimes.Dt FIND 1
339b50d902SRodney W. Grimes.Os
349b50d902SRodney W. Grimes.Sh NAME
359b50d902SRodney W. Grimes.Nm find
369b50d902SRodney W. Grimes.Nd walk a file hierarchy
379b50d902SRodney W. Grimes.Sh SYNOPSIS
388fe908efSRuslan Ermilov.Nm
399b50d902SRodney W. Grimes.Op Fl H | Fl L | Fl P
407c1d4b3aSAkinori MUSHA.Op Fl EXdsx
41dfab7fb1SRuslan Ermilov.Op Fl f Ar path
42dfab7fb1SRuslan Ermilov.Ar path ...
43dfab7fb1SRuslan Ermilov.Op Ar expression
44107f86a2SStefan Farfeleder.Nm
45107f86a2SStefan Farfeleder.Op Fl H | Fl L | Fl P
46107f86a2SStefan Farfeleder.Op Fl EXdsx
47dfab7fb1SRuslan Ermilov.Fl f Ar path
48dfab7fb1SRuslan Ermilov.Op Ar path ...
49dfab7fb1SRuslan Ermilov.Op Ar expression
509b50d902SRodney W. Grimes.Sh DESCRIPTION
51e8937ba0SPhilippe CharnierThe
52e8937ba0SPhilippe Charnier.Nm
53e8937ba0SPhilippe Charnierutility recursively descends the directory tree for each
54dfab7fb1SRuslan Ermilov.Ar path
559b50d902SRodney W. Grimeslisted, evaluating an
569b50d902SRodney W. Grimes.Ar expression
57bfd12208SRuslan Ermilov(composed of the
58bfd12208SRuslan Ermilov.Dq primaries
59bfd12208SRuslan Ermilovand
60bfd12208SRuslan Ermilov.Dq operands
61bfd12208SRuslan Ermilovlisted below) in terms
629b50d902SRodney W. Grimesof each file in the tree.
639b50d902SRodney W. Grimes.Pp
649b50d902SRodney W. GrimesThe options are as follows:
65bfd12208SRuslan Ermilov.Bl -tag -width indent
667c1d4b3aSAkinori MUSHA.It Fl E
6714ebab25SDag-Erling SmørgravInterpret regular expressions following the
687c1d4b3aSAkinori MUSHA.Ic -regex
697c1d4b3aSAkinori MUSHAand
707c1d4b3aSAkinori MUSHA.Ic -iregex
71fbccd9dbSRuslan Ermilovprimaries as extended (modern) regular expressions rather than basic
72bfd12208SRuslan Ermilovregular expressions (BRE's).
73bfd12208SRuslan ErmilovThe
747c1d4b3aSAkinori MUSHA.Xr re_format 7
757c1d4b3aSAkinori MUSHAmanual page fully describes both formats.
769b50d902SRodney W. Grimes.It Fl H
773c94f41fSPhilippe CharnierCause the file information and file type (see
789b50d902SRodney W. Grimes.Xr stat 2 )
799b50d902SRodney W. Grimesreturned for each symbolic link specified on the command line to be
809b50d902SRodney W. Grimesthose of the file referenced by the link, not the link itself.
819b50d902SRodney W. GrimesIf the referenced file does not exist, the file information and type will
826df69548SBruce Evansbe for the link itself.
836df69548SBruce EvansFile information of all symbolic links not on
849b50d902SRodney W. Grimesthe command line is that of the link itself.
859b50d902SRodney W. Grimes.It Fl L
863c94f41fSPhilippe CharnierCause the file information and file type (see
879b50d902SRodney W. Grimes.Xr stat 2 )
889b50d902SRodney W. Grimesreturned for each symbolic link to be those of the file referenced by the
899b50d902SRodney W. Grimeslink, not the link itself.
909b50d902SRodney W. GrimesIf the referenced file does not exist, the file information and type will
919b50d902SRodney W. Grimesbe for the link itself.
9247d91ba3SDag-Erling Smørgrav.Pp
9347d91ba3SDag-Erling SmørgravThis option is equivalent to the deprecated
9447d91ba3SDag-Erling Smørgrav.Ic -follow
9547d91ba3SDag-Erling Smørgravprimary.
969b50d902SRodney W. Grimes.It Fl P
973c94f41fSPhilippe CharnierCause the file information and file type (see
989b50d902SRodney W. Grimes.Xr stat 2 )
999b50d902SRodney W. Grimesreturned for each symbolic link to be those of the link itself.
1003d9a9402SJohn PolstraThis is the default.
1019b50d902SRodney W. Grimes.It Fl X
1023c94f41fSPhilippe CharnierPermit
1039b50d902SRodney W. Grimes.Nm
1049b50d902SRodney W. Grimesto be safely used in conjunction with
1059b50d902SRodney W. Grimes.Xr xargs 1 .
1069b50d902SRodney W. GrimesIf a file name contains any of the delimiting characters used by
107bfd12208SRuslan Ermilov.Xr xargs 1 ,
1089b50d902SRodney W. Grimesa diagnostic message is displayed on standard error, and the file
1099b50d902SRodney W. Grimesis skipped.
110bfd12208SRuslan ErmilovThe delimiting characters include single
111bfd12208SRuslan Ermilov.Pq Dq Li " ' "
112bfd12208SRuslan Ermilovand double
113bfd12208SRuslan Ermilov.Pq Dq Li " \*q "
114bfd12208SRuslan Ermilovquotes, backslash
115bfd12208SRuslan Ermilov.Pq Dq Li \e ,
116bfd12208SRuslan Ermilovspace, tab and newline characters.
117a8d50686STom Rhodes.Pp
118a8d50686STom RhodesHowever, you may wish to consider the
119a8d50686STom Rhodes.Fl print0
120a8d50686STom Rhodesprimary in conjunction with
121e2f8ed51SRuslan Ermilov.Dq Nm xargs Fl 0
122a8d50686STom Rhodesas an effective alternative.
1239b50d902SRodney W. Grimes.It Fl d
1243c94f41fSPhilippe CharnierCause
1258fe908efSRuslan Ermilov.Nm
126eb555785SJilles Tjoelkerto perform a depth-first traversal.
12747d91ba3SDag-Erling Smørgrav.Pp
128eb555785SJilles TjoelkerThis option is a BSD-specific equivalent of the
12947d91ba3SDag-Erling Smørgrav.Ic -depth
130eb555785SJilles Tjoelkerprimary specified by
1311c832963SOliver Eikemeier.St -p1003.1-2001 .
132eb555785SJilles TjoelkerRefer to its description under
133eb555785SJilles Tjoelker.Sx PRIMARIES
134eb555785SJilles Tjoelkerfor more information.
13582483ea7SCeri Davies.It Fl f Ar path
13682483ea7SCeri DaviesAdd
13782483ea7SCeri Davies.Ar path
13882483ea7SCeri Daviesto the list of paths that will be recursed into.
13982483ea7SCeri DaviesThis is useful when
14082483ea7SCeri Davies.Ar path
14182483ea7SCeri Daviesbegins with a character that would otherwise be interpreted as an
14282483ea7SCeri Davies.Ar expression ,
14382483ea7SCeri Daviesnamely
14482483ea7SCeri Davies.Dq Li "!" ,
14582483ea7SCeri Davies.Dq Li "("
14682483ea7SCeri Daviesand
14782483ea7SCeri Davies.Dq Li - .
1486d0c7e13SWolfram Schneider.It Fl s
1493c94f41fSPhilippe CharnierCause
1508fe908efSRuslan Ermilov.Nm
1516df69548SBruce Evansto traverse the file hierarchies in lexicographical order,
1526df69548SBruce Evansi.e., alphabetical order within each directory.
1536df69548SBruce EvansNote:
154bfd12208SRuslan Ermilov.Ql find -s
1556d0c7e13SWolfram Schneiderand
156bfd12208SRuslan Ermilov.Ql "find | sort"
1576d0c7e13SWolfram Schneidermay give different results.
15826a329f4SEugene Grosbein.Pp
15926a329f4SEugene GrosbeinFor example,
16026a329f4SEugene Grosbein.Ql find -s
16126a329f4SEugene Grosbeinputs a directory
16226a329f4SEugene Grosbein.Ql Ar foo
16326a329f4SEugene Grosbeinwith all its contents before a directory
16426a329f4SEugene Grosbein.Ql Ar foo .
16526a329f4SEugene Grosbeinbut
16626a329f4SEugene Grosbein.Ql "find | sort"
16726a329f4SEugene Grosbeinputs the directory name
16826a329f4SEugene Grosbein.Ql Ar foo .
16926a329f4SEugene Grosbeinbefore any string like
17026a329f4SEugene Grosbein.Ql Ar foo/bar
17126a329f4SEugene Grosbeinbecause
17226a329f4SEugene Grosbein.Ql .\&
17326a329f4SEugene Grosbeingoes before
17426a329f4SEugene Grosbein.Ql /
17593b8510cSGordon Berglingin ASCII.
176321dc6eeSGordon BerglingIn locales other than
17726a329f4SEugene Grosbein.Ar C
178d6054ee6SEugene Grosbeinresults may vary more due to collation differences.
1799b50d902SRodney W. Grimes.It Fl x
1803c94f41fSPhilippe CharnierPrevent
1818fe908efSRuslan Ermilov.Nm
1829b50d902SRodney W. Grimesfrom descending into directories that have a device number different
1839b50d902SRodney W. Grimesthan that of the file from which the descent began.
18447d91ba3SDag-Erling Smørgrav.Pp
18547d91ba3SDag-Erling SmørgravThis option is equivalent to the deprecated
18647d91ba3SDag-Erling Smørgrav.Ic -xdev
18747d91ba3SDag-Erling Smørgravprimary.
1889b50d902SRodney W. Grimes.El
1899b50d902SRodney W. Grimes.Sh PRIMARIES
190be2cad28SGlen BarberAll primaries which take a numeric argument allow the number to be
191be2cad28SGlen Barberpreceded by a plus sign
192be2cad28SGlen Barber.Pq Dq Li +
193be2cad28SGlen Barberor a minus sign
194be2cad28SGlen Barber.Pq Dq Li - .
195be2cad28SGlen BarberA preceding plus sign means
196be2cad28SGlen Barber.Dq more than n ,
197be2cad28SGlen Barbera preceding minus sign means
198be2cad28SGlen Barber.Dq less than n
199be2cad28SGlen Barberand neither means
200be2cad28SGlen Barber.Dq exactly n .
201bfd12208SRuslan Ermilov.Bl -tag -width indent
20231d53425SCeri Davies.It Ic -Bmin Ar n
20331d53425SCeri DaviesTrue if the difference between the time of a file's inode creation
20431d53425SCeri Daviesand the time
20531d53425SCeri Davies.Nm
20631d53425SCeri Davieswas started, rounded up to the next full minute, is
20731d53425SCeri Davies.Ar n
20831d53425SCeri Daviesminutes.
20931d53425SCeri Davies.It Ic -Bnewer Ar file
21031d53425SCeri DaviesSame as
21131d53425SCeri Davies.Ic -newerBm .
21231d53425SCeri Davies.It Ic -Btime Ar n Ns Op Cm smhdw
21331d53425SCeri DaviesIf no units are specified, this primary evaluates to
21431d53425SCeri Daviestrue if the difference between the time of a file's inode creation
21531d53425SCeri Daviesand the time
21631d53425SCeri Davies.Nm
21731d53425SCeri Davieswas started, rounded up to the next full 24-hour period, is
21831d53425SCeri Davies.Ar n
21931d53425SCeri Davies24-hour periods.
22031d53425SCeri Davies.Pp
22131d53425SCeri DaviesIf units are specified, this primary evaluates to
2223b0fbd31SRuslan Ermilovtrue if the difference between the time of a file's inode creation
2233b0fbd31SRuslan Ermilovand the time
22431d53425SCeri Davies.Nm
22531d53425SCeri Davieswas started is exactly
22631d53425SCeri Davies.Ar n
22731d53425SCeri Daviesunits.
22831d53425SCeri DaviesPlease refer to the
22931d53425SCeri Davies.Ic -atime
23031d53425SCeri Daviesprimary description for information on supported time units.
23153e87059STom Rhodes.It Ic -acl
232fbccd9dbSRuslan ErmilovMay be used in conjunction with other primaries to locate
23353e87059STom Rhodesfiles with extended ACLs.
23453e87059STom RhodesSee
23553e87059STom Rhodes.Xr acl 3
23653e87059STom Rhodesfor more information.
237115b335eSEitan Adler.It Ic -amin Oo Cm - Ns | Ns Cm + Oc Ns Ar n
2383f5223f8SWolfram SchneiderTrue if the difference between the file last access time and the time
2398fe908efSRuslan Ermilov.Nm
24045fe9882SMatthew Huntwas started, rounded up to the next full minute, is
241115b335eSEitan Adlermore than
2423f5223f8SWolfram Schneider.Ar n
243115b335eSEitan Adler.Pq + Ns Ar n ,
244115b335eSEitan Adlerless than
245115b335eSEitan Adler.Ar n
246115b335eSEitan Adler.Pq - Ns Ar n ,
247115b335eSEitan Adleror exactly
248115b335eSEitan Adler.Ar n
249115b335eSEitan Adlerminutes ago.
250ea92232aSPoul-Henning Kamp.It Ic -anewer Ar file
251ea92232aSPoul-Henning KampSame as
252ea92232aSPoul-Henning Kamp.Ic -neweram .
253adff4fcaSRuslan Ermilov.It Ic -atime Ar n Ns Op Cm smhdw
254adff4fcaSRuslan ErmilovIf no units are specified, this primary evaluates to
255adff4fcaSRuslan Ermilovtrue if the difference between the file last access time and the time
2568fe908efSRuslan Ermilov.Nm
25754874bb6SRuslan Ermilovwas started, rounded up to the next full 24-hour period, is
2589b50d902SRodney W. Grimes.Ar n
25954874bb6SRuslan Ermilov24-hour periods.
260adff4fcaSRuslan Ermilov.Pp
261adff4fcaSRuslan ErmilovIf units are specified, this primary evaluates to
262adff4fcaSRuslan Ermilovtrue if the difference between the file last access time and the time
263adff4fcaSRuslan Ermilov.Nm
264adff4fcaSRuslan Ermilovwas started is exactly
265adff4fcaSRuslan Ermilov.Ar n
266adff4fcaSRuslan Ermilovunits.
267adff4fcaSRuslan ErmilovPossible time units are as follows:
268adff4fcaSRuslan Ermilov.Pp
269adff4fcaSRuslan Ermilov.Bl -tag -width indent -compact
270adff4fcaSRuslan Ermilov.It Cm s
271adff4fcaSRuslan Ermilovsecond
272adff4fcaSRuslan Ermilov.It Cm m
273adff4fcaSRuslan Ermilovminute (60 seconds)
274adff4fcaSRuslan Ermilov.It Cm h
275adff4fcaSRuslan Ermilovhour (60 minutes)
276adff4fcaSRuslan Ermilov.It Cm d
277adff4fcaSRuslan Ermilovday (24 hours)
278adff4fcaSRuslan Ermilov.It Cm w
279adff4fcaSRuslan Ermilovweek (7 days)
280adff4fcaSRuslan Ermilov.El
281adff4fcaSRuslan Ermilov.Pp
282adff4fcaSRuslan ErmilovAny number of units may be combined in one
283adff4fcaSRuslan Ermilov.Ic -atime
284adff4fcaSRuslan Ermilovargument, for example,
285adff4fcaSRuslan Ermilov.Dq Li "-atime -1h30m" .
286adff4fcaSRuslan ErmilovUnits are probably only useful when used in conjunction with the
287adff4fcaSRuslan Ermilov.Cm +
288adff4fcaSRuslan Ermilovor
289adff4fcaSRuslan Ermilov.Cm -
290adff4fcaSRuslan Ermilovmodifier.
291115b335eSEitan Adler.It Ic -cmin Oo Cm - Ns | Ns Cm + Oc Ns Ar n
2923f5223f8SWolfram SchneiderTrue if the difference between the time of last change of file status
2933f5223f8SWolfram Schneiderinformation and the time
2948fe908efSRuslan Ermilov.Nm
29545fe9882SMatthew Huntwas started, rounded up to the next full minute, is
296115b335eSEitan Adlermore than
2973f5223f8SWolfram Schneider.Ar n
298115b335eSEitan Adler.Pq + Ns Ar n ,
299115b335eSEitan Adlerless than
300115b335eSEitan Adler.Ar n
301115b335eSEitan Adler.Pq - Ns Ar n ,
302115b335eSEitan Adleror exactly
303115b335eSEitan Adler.Ar n
304115b335eSEitan Adlerminutes ago.
305ea92232aSPoul-Henning Kamp.It Ic -cnewer Ar file
306ea92232aSPoul-Henning KampSame as
307ea92232aSPoul-Henning Kamp.Ic -newercm .
308adff4fcaSRuslan Ermilov.It Ic -ctime Ar n Ns Op Cm smhdw
309adff4fcaSRuslan ErmilovIf no units are specified, this primary evaluates to
310adff4fcaSRuslan Ermilovtrue if the difference between the time of last change of file status
3119b50d902SRodney W. Grimesinformation and the time
3128fe908efSRuslan Ermilov.Nm
31354874bb6SRuslan Ermilovwas started, rounded up to the next full 24-hour period, is
3149b50d902SRodney W. Grimes.Ar n
31554874bb6SRuslan Ermilov24-hour periods.
316adff4fcaSRuslan Ermilov.Pp
317adff4fcaSRuslan ErmilovIf units are specified, this primary evaluates to
318adff4fcaSRuslan Ermilovtrue if the difference between the time of last change of file status
319adff4fcaSRuslan Ermilovinformation and the time
320adff4fcaSRuslan Ermilov.Nm
321adff4fcaSRuslan Ermilovwas started is exactly
322adff4fcaSRuslan Ermilov.Ar n
323adff4fcaSRuslan Ermilovunits.
324adff4fcaSRuslan ErmilovPlease refer to the
325adff4fcaSRuslan Ermilov.Ic -atime
326adff4fcaSRuslan Ermilovprimary description for information on supported time units.
32746b993ffSWarner Losh.It Ic -d
328a8622446SIsabell LongNon-portable, BSD-specific version of
32946b993ffSWarner Losh.Ic depth .
33046b993ffSWarner LoshGNU find implements this as a primary in mistaken emulation of
33146b993ffSWarner Losh.Fx
33281b295a1SEitan Adler.Nm .
333abacbbbfSPeter Wemm.It Ic -delete
3346df69548SBruce EvansDelete found files and/or directories.
3356df69548SBruce EvansAlways returns true.
3366df69548SBruce EvansThis executes
337abacbbbfSPeter Wemmfrom the current working directory as
338abacbbbfSPeter Wemm.Nm
3396df69548SBruce Evansrecurses down the tree.
340bfd12208SRuslan ErmilovIt will not attempt to delete a filename with a
341bfd12208SRuslan Ermilov.Dq Pa /
342bfd12208SRuslan Ermilovcharacter in its pathname relative to
343bfd12208SRuslan Ermilov.Dq Pa \&.
344bfd12208SRuslan Ermilovfor security reasons.
34554874bb6SRuslan ErmilovDepth-first traversal processing is implied by this option.
3465102783bSEitan AdlerThe
3475102783bSEitan Adler.Ic -delete
3485102783bSEitan Adlerprimary will fail to delete a directory if it is not empty.
349a05cb852SJilles TjoelkerFollowing symlinks is incompatible with this option.
35045438f9cSDag-Erling Smørgrav.Pp
35145438f9cSDag-Erling Smørgrav.Em WARNING :
35245438f9cSDag-Erling SmørgravThe
35345438f9cSDag-Erling Smørgrav.Ic -delete
35445438f9cSDag-Erling Smørgravprimary will immediately attempt to delete the current path when
35545438f9cSDag-Erling Smørgravevaluated.
35645438f9cSDag-Erling SmørgravBe mindful of its place in the expression; as a general rule, it
35745438f9cSDag-Erling Smørgravshould almost always come last.
35845438f9cSDag-Erling SmørgravIf in doubt, try running with
35945438f9cSDag-Erling Smørgrav.Ic -print
36045438f9cSDag-Erling Smørgravin place of
36145438f9cSDag-Erling Smørgrav.Ic -delete
36245438f9cSDag-Erling Smørgravfirst.
36345438f9cSDag-Erling SmørgravSee
36445438f9cSDag-Erling Smørgrav.Sx OPERATORS
36545438f9cSDag-Erling Smørgravbelow for additional information on the order of evaluation.
3669b4e871aSDavid E. O'Brien.It Ic -depth
3679b4e871aSDavid E. O'BrienAlways true;
368a8622446SIsabell Longsame as the non-portable
3699b4e871aSDavid E. O'Brien.Fl d
370eb555785SJilles Tjoelkeroption.
371eb555785SJilles TjoelkerCause
372eb555785SJilles Tjoelker.Nm
373eb555785SJilles Tjoelkerto perform a depth-first traversal, i.e., directories
374eb555785SJilles Tjoelkerare visited in post-order and all entries in a directory will be acted
375eb555785SJilles Tjoelkeron before the directory itself.
376eb555785SJilles TjoelkerBy default,
377eb555785SJilles Tjoelker.Nm
378eb555785SJilles Tjoelkervisits directories in pre-order, i.e., before their contents.
379eb555785SJilles TjoelkerNote, the default is
380eb555785SJilles Tjoelker.Em not
381eb555785SJilles Tjoelkera breadth-first traversal.
382eb555785SJilles Tjoelker.Pp
383eb555785SJilles TjoelkerThe
384eb555785SJilles Tjoelker.Ic -depth
385eb555785SJilles Tjoelkerprimary
386eb555785SJilles Tjoelkercan be useful when
387eb555785SJilles Tjoelker.Nm
388eb555785SJilles Tjoelkeris used with
389eb555785SJilles Tjoelker.Xr cpio 1
390eb555785SJilles Tjoelkerto process files that are contained in directories with unusual permissions.
391eb555785SJilles TjoelkerIt ensures that you have write permission while you are placing files in a
392eb555785SJilles Tjoelkerdirectory, then sets the directory's permissions as the last thing.
3931c832963SOliver Eikemeier.It Ic -depth Ar n
3941c832963SOliver EikemeierTrue if the depth of the file relative to the starting point of the traversal
3951c832963SOliver Eikemeieris
3961c832963SOliver Eikemeier.Ar n .
397ed1a4621SPeter Wemm.It Ic -empty
398ed1a4621SPeter WemmTrue if the current file or directory is empty.
399c93e83feSRuslan Ermilov.It Ic -exec Ar utility Oo Ar argument ... Oc Li \&;
4009b50d902SRodney W. GrimesTrue if the program named
4019b50d902SRodney W. Grimes.Ar utility
4029b50d902SRodney W. Grimesreturns a zero value as its exit status.
403bfd12208SRuslan ErmilovOptional
404bfd12208SRuslan Ermilov.Ar arguments
405bfd12208SRuslan Ermilovmay be passed to the utility.
406bfd12208SRuslan ErmilovThe expression must be terminated by a semicolon
407bfd12208SRuslan Ermilov.Pq Dq Li \&; .
4086a2b59f8SJens SchweikhardtIf you invoke
4096a2b59f8SJens Schweikhardt.Nm
4106a2b59f8SJens Schweikhardtfrom a shell you may need to quote the semicolon if the shell would
4116a2b59f8SJens Schweikhardtotherwise treat it as a control operator.
412bfd12208SRuslan ErmilovIf the string
413bfd12208SRuslan Ermilov.Dq Li {}
414bfd12208SRuslan Ermilovappears anywhere in the utility name or the
4159b50d902SRodney W. Grimesarguments it is replaced by the pathname of the current file.
4169b50d902SRodney W. Grimes.Ar Utility
4179b50d902SRodney W. Grimeswill be executed from the directory from which
4188fe908efSRuslan Ermilov.Nm
4199b50d902SRodney W. Grimeswas executed.
42008274979SYaroslav Tykhiy.Ar Utility
42108274979SYaroslav Tykhiyand
42208274979SYaroslav Tykhiy.Ar arguments
42308274979SYaroslav Tykhiyare not subject to the further expansion of shell patterns
42408274979SYaroslav Tykhiyand constructs.
425c93e83feSRuslan Ermilov.It Ic -exec Ar utility Oo Ar argument ... Oc Li {} +
4265e25d888STim J. RobbinsSame as
4275e25d888STim J. Robbins.Ic -exec ,
4285e25d888STim J. Robbinsexcept that
4295e25d888STim J. Robbins.Dq Li {}
4305e25d888STim J. Robbinsis replaced with as many pathnames as possible for each invocation of
4315e25d888STim J. Robbins.Ar utility .
4325e25d888STim J. RobbinsThis behaviour is similar to that of
4335e25d888STim J. Robbins.Xr xargs 1 .
4347a79617cSJilles TjoelkerThe primary always returns true;
4357a79617cSJilles Tjoelkerif at least one invocation of
4367a79617cSJilles Tjoelker.Ar utility
4377a79617cSJilles Tjoelkerreturns a non-zero exit status,
4387a79617cSJilles Tjoelker.Nm
4397a79617cSJilles Tjoelkerwill return a non-zero exit status.
440c93e83feSRuslan Ermilov.It Ic -execdir Ar utility Oo Ar argument ... Oc Li \&;
441127d7563SWarner LoshThe
442bfd12208SRuslan Ermilov.Ic -execdir
443127d7563SWarner Loshprimary is identical to the
444127d7563SWarner Losh.Ic -exec
445127d7563SWarner Loshprimary with the exception that
446bfd12208SRuslan Ermilov.Ar utility
447127d7563SWarner Loshwill be executed from the directory that holds
4486df69548SBruce Evansthe current file.
4496df69548SBruce EvansThe filename substituted for
450bfd12208SRuslan Ermilovthe string
451bfd12208SRuslan Ermilov.Dq Li {}
452bfd12208SRuslan Ermilovis not qualified.
45346b993ffSWarner Losh.It Ic -execdir Ar utility Oo Ar argument ... Oc Li {} +
45446b993ffSWarner LoshSame as
45546b993ffSWarner Losh.Ic -execdir ,
45646b993ffSWarner Loshexcept that
45746b993ffSWarner Losh.Dq Li {}
45846b993ffSWarner Loshis replaced with as many pathnames as possible for each invocation of
45946b993ffSWarner Losh.Ar utility .
46046b993ffSWarner LoshThis behaviour is similar to that of
46146b993ffSWarner Losh.Xr xargs 1 .
4627a79617cSJilles TjoelkerThe primary always returns true;
4637a79617cSJilles Tjoelkerif at least one invocation of
4647a79617cSJilles Tjoelker.Ar utility
4657a79617cSJilles Tjoelkerreturns a non-zero exit status,
4667a79617cSJilles Tjoelker.Nm
4677a79617cSJilles Tjoelkerwill return a non-zero exit status.
468e4b646ceSRicardo Branco.It Ic -executable
469e4b646ceSRicardo BrancoMatches files which are executable by the current user.
470e4b646ceSRicardo BrancoThis test makes use of the
471e4b646ceSRicardo Branco.Xr access 2
472e4b646ceSRicardo Brancosystem call, and so can be fooled by NFS servers which do UID mapping (or root-squashing).
473e4b646ceSRicardo BrancoThis is a GNU find extension.
4747fd5ee41SRuslan Ermilov.It Ic -flags Oo Cm - Ns | Ns Cm + Oc Ns Ar flags , Ns Ar notflags
4757fd5ee41SRuslan ErmilovThe flags are specified using symbolic names (see
476208691fcSRuslan Ermilov.Xr chflags 1 ) .
4777fd5ee41SRuslan ErmilovThose with the
4787fd5ee41SRuslan Ermilov.Qq Li no
4797fd5ee41SRuslan Ermilovprefix (except
4807fd5ee41SRuslan Ermilov.Qq Li nodump )
4817fd5ee41SRuslan Ermilovare said to be
4827fd5ee41SRuslan Ermilov.Ar notflags .
4837fd5ee41SRuslan ErmilovFlags in
4847fd5ee41SRuslan Ermilov.Ar flags
4857fd5ee41SRuslan Ermilovare checked to be set, and flags in
4867fd5ee41SRuslan Ermilov.Ar notflags
4877fd5ee41SRuslan Ermilovare checked to be not set.
488208691fcSRuslan ErmilovNote that this is different from
489208691fcSRuslan Ermilov.Ic -perm ,
4907fd5ee41SRuslan Ermilovwhich only allows the user to specify mode bits that are set.
4917fd5ee41SRuslan Ermilov.Pp
4927fd5ee41SRuslan ErmilovIf flags are preceded by a dash
4937fd5ee41SRuslan Ermilov.Pq Dq Li - ,
4947fd5ee41SRuslan Ermilovthis primary evaluates to true
4957fd5ee41SRuslan Ermilovif at least all of the bits in
4967fd5ee41SRuslan Ermilov.Ar flags
4977fd5ee41SRuslan Ermilovand none of the bits in
4987fd5ee41SRuslan Ermilov.Ar notflags
4997fd5ee41SRuslan Ermilovare set in the file's flags bits.
5007fd5ee41SRuslan ErmilovIf flags are preceded by a plus
5017fd5ee41SRuslan Ermilov.Pq Dq Li + ,
5027fd5ee41SRuslan Ermilovthis primary evaluates to true
5037fd5ee41SRuslan Ermilovif any of the bits in
5047fd5ee41SRuslan Ermilov.Ar flags
5057fd5ee41SRuslan Ermilovis set in the file's flags bits,
5067fd5ee41SRuslan Ermilovor any of the bits in
5077fd5ee41SRuslan Ermilov.Ar notflags
5087fd5ee41SRuslan Ermilovis not set in the file's flags bits.
5097fd5ee41SRuslan ErmilovOtherwise,
5107fd5ee41SRuslan Ermilovthis primary evaluates to true
5117fd5ee41SRuslan Ermilovif the bits in
5127fd5ee41SRuslan Ermilov.Ar flags
5137fd5ee41SRuslan Ermilovexactly match the file's flags bits,
5147fd5ee41SRuslan Ermilovand none of the
5157fd5ee41SRuslan Ermilov.Ar flags
5167fd5ee41SRuslan Ermilovbits match those of
5177fd5ee41SRuslan Ermilov.Ar notflags .
5189b50d902SRodney W. Grimes.It Ic -fstype Ar type
5199b50d902SRodney W. GrimesTrue if the file is contained in a file system of type
5209b50d902SRodney W. Grimes.Ar type .
521841484cdSPeter WemmThe
522d740b7c7SPawel Jakub Dawidek.Xr lsvfs 1
523841484cdSPeter Wemmcommand can be used to find out the types of file systems
524d740b7c7SPawel Jakub Dawidekthat are available on the system.
525bfd12208SRuslan ErmilovIn addition, there are two pseudo-types,
526bfd12208SRuslan Ermilov.Dq Li local
527bfd12208SRuslan Ermilovand
528bfd12208SRuslan Ermilov.Dq Li rdonly .
5299b50d902SRodney W. GrimesThe former matches any file system physically mounted on the system where
5309b50d902SRodney W. Grimesthe
5318fe908efSRuslan Ermilov.Nm
5329b50d902SRodney W. Grimesis being executed and the latter matches any file system which is
5339b50d902SRodney W. Grimesmounted read-only.
53446b993ffSWarner Losh.It Ic -gid Ar gname
53546b993ffSWarner LoshThe same thing as
53693e0e298SMateusz Piotrowski.Ic -group Ar gname
53746b993ffSWarner Loshfor compatibility with GNU find.
53846b993ffSWarner LoshGNU find imposes a restriction that
53946b993ffSWarner Losh.Ar gname
54046b993ffSWarner Loshis numeric, while
54181b295a1SEitan Adler.Nm
54246b993ffSWarner Loshdoes not.
5439b50d902SRodney W. Grimes.It Ic -group Ar gname
5449b50d902SRodney W. GrimesTrue if the file belongs to the group
5459b50d902SRodney W. Grimes.Ar gname .
5469b50d902SRodney W. GrimesIf
5479b50d902SRodney W. Grimes.Ar gname
5489b50d902SRodney W. Grimesis numeric and there is no such group name, then
5499b50d902SRodney W. Grimes.Ar gname
550bfd12208SRuslan Ermilovis treated as a group ID.
55146b993ffSWarner Losh.It Ic -ignore_readdir_race
55240072dc2SJilles TjoelkerIgnore errors because a file or a directory is deleted
55340072dc2SJilles Tjoelkerafter reading the name from a directory.
55440072dc2SJilles TjoelkerThis option does not affect errors occurring on starting points.
55546b993ffSWarner Losh.It Ic -ilname Ar pattern
55646b993ffSWarner LoshLike
55746b993ffSWarner Losh.Ic -lname ,
55846b993ffSWarner Loshbut the match is case insensitive.
559a66a6a2aSWarner LoshThis is a GNU find extension.
560208691fcSRuslan Ermilov.It Ic -iname Ar pattern
561208691fcSRuslan ErmilovLike
562208691fcSRuslan Ermilov.Ic -name ,
563208691fcSRuslan Ermilovbut the match is case insensitive.
5649b50d902SRodney W. Grimes.It Ic -inum Ar n
5659b50d902SRodney W. GrimesTrue if the file has inode number
5669b50d902SRodney W. Grimes.Ar n .
567208691fcSRuslan Ermilov.It Ic -ipath Ar pattern
568208691fcSRuslan ErmilovLike
569208691fcSRuslan Ermilov.Ic -path ,
570208691fcSRuslan Ermilovbut the match is case insensitive.
571208691fcSRuslan Ermilov.It Ic -iregex Ar pattern
572208691fcSRuslan ErmilovLike
573208691fcSRuslan Ermilov.Ic -regex ,
574208691fcSRuslan Ermilovbut the match is case insensitive.
57546b993ffSWarner Losh.It Ic -iwholename Ar pattern
57646b993ffSWarner LoshThe same thing as
57746b993ffSWarner Losh.Ic -ipath ,
57846b993ffSWarner Loshfor GNU find compatibility.
5799b50d902SRodney W. Grimes.It Ic -links Ar n
5809b50d902SRodney W. GrimesTrue if the file has
5819b50d902SRodney W. Grimes.Ar n
5829b50d902SRodney W. Grimeslinks.
58346b993ffSWarner Losh.It Ic -lname Ar pattern
58446b993ffSWarner LoshLike
58546b993ffSWarner Losh.Ic -name ,
586a66a6a2aSWarner Loshbut the contents of the symbolic link are matched instead of the file
587a66a6a2aSWarner Loshname.
588e810bef7SJilles TjoelkerNote that this only matches broken symbolic links
589e810bef7SJilles Tjoelkerif symbolic links are being followed.
590a66a6a2aSWarner LoshThis is a GNU find extension.
5919b50d902SRodney W. Grimes.It Ic -ls
5929b50d902SRodney W. GrimesThis primary always evaluates to true.
5939b50d902SRodney W. GrimesThe following information for the current file is written to standard output:
59454874bb6SRuslan Ermilovits inode number, size in 512-byte blocks, file permissions, number of hard
5959b50d902SRodney W. Grimeslinks, owner, group, size in bytes, last modification time, and pathname.
5969f365aa1SEd SchoutenIf the file is a block or character special file, the device number
5979b50d902SRodney W. Grimeswill be displayed instead of the size in bytes.
59854874bb6SRuslan ErmilovIf the file is a symbolic link, the pathname of the linked-to file will be
599bfd12208SRuslan Ermilovdisplayed preceded by
600bfd12208SRuslan Ermilov.Dq Li -> .
601bfd12208SRuslan ErmilovThe format is identical to that produced by
602bfd12208SRuslan Ermilov.Bk -words
603*b4ede68cSThomas Eberhardt.Dq Nm ls Fl dils .
604bfd12208SRuslan Ermilov.Ek
605c76bc8f3SOllivier Robert.It Ic -maxdepth Ar n
6069c61111dSOliver EikemeierAlways true; descend at most
6079c61111dSOliver Eikemeier.Ar n
6089c61111dSOliver Eikemeierdirectory levels below the command line arguments.
609d79829afSOliver EikemeierIf any
610d79829afSOliver Eikemeier.Ic -maxdepth
611d79829afSOliver Eikemeierprimary is specified, it applies to the entire expression even if it would
612d79829afSOliver Eikemeiernot normally be evaluated.
613fbccd9dbSRuslan Ermilov.Dq Ic -maxdepth Li 0
614d79829afSOliver Eikemeierlimits the whole search to the command line arguments.
615c76bc8f3SOllivier Robert.It Ic -mindepth Ar n
6169c61111dSOliver EikemeierAlways true; do not apply any tests or actions at levels less than
6179c61111dSOliver Eikemeier.Ar n .
618d79829afSOliver EikemeierIf any
619d79829afSOliver Eikemeier.Ic -mindepth
620d79829afSOliver Eikemeierprimary is specified, it applies to the entire expression even if it would
621d79829afSOliver Eikemeiernot normally be evaluated.
622fbccd9dbSRuslan Ermilov.Dq Ic -mindepth Li 1
623d79829afSOliver Eikemeierprocesses all but the command line arguments.
624115b335eSEitan Adler.It Ic -mmin Oo Cm - Ns | Ns Cm + Oc Ns Ar n
6253f5223f8SWolfram SchneiderTrue if the difference between the file last modification time and the time
6268fe908efSRuslan Ermilov.Nm
62745fe9882SMatthew Huntwas started, rounded up to the next full minute, is
62816ce602cSSevan Janiyanmore than
6293f5223f8SWolfram Schneider.Ar n
630115b335eSEitan Adler.Pq + Ns Ar n ,
631115b335eSEitan Adlerless than
632115b335eSEitan Adler.Ar n
633115b335eSEitan Adler.Pq - Ns Ar n ,
634115b335eSEitan Adleror exactly
635115b335eSEitan Adler.Ar n
636115b335eSEitan Adlerminutes ago.
637208691fcSRuslan Ermilov.It Ic -mnewer Ar file
638208691fcSRuslan ErmilovSame as
639208691fcSRuslan Ermilov.Ic -newer .
64046b993ffSWarner Losh.It Ic -mount
64146b993ffSWarner LoshThe same thing as
64246b993ffSWarner Losh.Ic -xdev ,
64346b993ffSWarner Loshfor GNU find compatibility.
644adff4fcaSRuslan Ermilov.It Ic -mtime Ar n Ns Op Cm smhdw
645adff4fcaSRuslan ErmilovIf no units are specified, this primary evaluates to
646adff4fcaSRuslan Ermilovtrue if the difference between the file last modification time and the time
6478fe908efSRuslan Ermilov.Nm
64854874bb6SRuslan Ermilovwas started, rounded up to the next full 24-hour period, is
6499b50d902SRodney W. Grimes.Ar n
65054874bb6SRuslan Ermilov24-hour periods.
651adff4fcaSRuslan Ermilov.Pp
652adff4fcaSRuslan ErmilovIf units are specified, this primary evaluates to
653adff4fcaSRuslan Ermilovtrue if the difference between the file last modification time and the time
654adff4fcaSRuslan Ermilov.Nm
655adff4fcaSRuslan Ermilovwas started is exactly
656adff4fcaSRuslan Ermilov.Ar n
657adff4fcaSRuslan Ermilovunits.
658adff4fcaSRuslan ErmilovPlease refer to the
659adff4fcaSRuslan Ermilov.Ic -atime
660adff4fcaSRuslan Ermilovprimary description for information on supported time units.
6619b50d902SRodney W. Grimes.It Ic -name Ar pattern
6629b50d902SRodney W. GrimesTrue if the last component of the pathname being examined matches
6639b50d902SRodney W. Grimes.Ar pattern .
664bfd12208SRuslan ErmilovSpecial shell pattern matching characters
665bfd12208SRuslan Ermilov.Dq ( Li \&[ ,
666bfd12208SRuslan Ermilov.Dq Li \&] ,
667bfd12208SRuslan Ermilov.Dq Li * ,
668bfd12208SRuslan Ermilovand
669bfd12208SRuslan Ermilov.Dq Li \&? )
6709b50d902SRodney W. Grimesmay be used as part of
6719b50d902SRodney W. Grimes.Ar pattern .
6729b50d902SRodney W. GrimesThese characters may be matched explicitly by escaping them with a
673bfd12208SRuslan Ermilovbackslash
674bfd12208SRuslan Ermilov.Pq Dq Li \e .
6759b50d902SRodney W. Grimes.It Ic -newer Ar file
6769b50d902SRodney W. GrimesTrue if the current file has a more recent last modification time than
6779b50d902SRodney W. Grimes.Ar file .
678bfd12208SRuslan Ermilov.It Ic -newer Ns Ar X Ns Ar Y Ar file
679bfd12208SRuslan ErmilovTrue if the current file has a more recent last access time
680fbccd9dbSRuslan Ermilov.Pq Ar X Ns = Ns Cm a ,
68131d53425SCeri Daviesinode creation time
682fbccd9dbSRuslan Ermilov.Pq Ar X Ns = Ns Cm B ,
683bfd12208SRuslan Ermilovchange time
684fbccd9dbSRuslan Ermilov.Pq Ar X Ns = Ns Cm c ,
685bfd12208SRuslan Ermilovor modification time
686fbccd9dbSRuslan Ermilov.Pq Ar X Ns = Ns Cm m
687bfd12208SRuslan Ermilovthan the last access time
688fbccd9dbSRuslan Ermilov.Pq Ar Y Ns = Ns Cm a ,
68931d53425SCeri Daviesinode creation time
690fbccd9dbSRuslan Ermilov.Pq Ar Y Ns = Ns Cm B ,
691bfd12208SRuslan Ermilovchange time
692fbccd9dbSRuslan Ermilov.Pq Ar Y Ns = Ns Cm c ,
693bfd12208SRuslan Ermilovor modification time
694fbccd9dbSRuslan Ermilov.Pq Ar Y Ns = Ns Cm m
695bfd12208SRuslan Ermilovof
696ea92232aSPoul-Henning Kamp.Ar file .
697ea92232aSPoul-Henning KampIn addition, if
698bfd12208SRuslan Ermilov.Ar Y Ns = Ns Cm t ,
699ea92232aSPoul-Henning Kampthen
700ea92232aSPoul-Henning Kamp.Ar file
701ea92232aSPoul-Henning Kampis instead interpreted as a direct date specification of the form
70252dbe1a0SFelix Johnsonunderstood by ISO8601 or RFC822.
703ea92232aSPoul-Henning KampNote that
704ea92232aSPoul-Henning Kamp.Ic -newermm
705ea92232aSPoul-Henning Kampis equivalent to
706ea92232aSPoul-Henning Kamp.Ic -newer .
7079b50d902SRodney W. Grimes.It Ic -nogroup
7089b50d902SRodney W. GrimesTrue if the file belongs to an unknown group.
70946b993ffSWarner Losh.It Ic -noignore_readdir_race
71040072dc2SJilles TjoelkerTurn off the effect of
71140072dc2SJilles Tjoelker.Ic -ignore_readdir_race .
71240072dc2SJilles TjoelkerThis is default behaviour.
71346b993ffSWarner Losh.It Ic -noleaf
71446b993ffSWarner LoshThis option is for GNU find compatibility.
71546b993ffSWarner LoshIn GNU find it disables an optimization not relevant to
71681b295a1SEitan Adler.Nm ,
71746b993ffSWarner Loshso it is ignored.
718208691fcSRuslan Ermilov.It Ic -nouser
719208691fcSRuslan ErmilovTrue if the file belongs to an unknown user.
720c93e83feSRuslan Ermilov.It Ic -ok Ar utility Oo Ar argument ... Oc Li \&;
721208691fcSRuslan ErmilovThe
722208691fcSRuslan Ermilov.Ic -ok
723208691fcSRuslan Ermilovprimary is identical to the
724208691fcSRuslan Ermilov.Ic -exec
725208691fcSRuslan Ermilovprimary with the exception that
726208691fcSRuslan Ermilov.Nm
727208691fcSRuslan Ermilovrequests user affirmation for the execution of the
728208691fcSRuslan Ermilov.Ar utility
729208691fcSRuslan Ermilovby printing
730208691fcSRuslan Ermilova message to the terminal and reading a response.
73139c59153SRuslan ErmilovIf the response is not affirmative
73239c59153SRuslan Ermilov.Ql ( y
733ef6c7764STim J. Robbinsin the
734ef6c7764STim J. Robbins.Dq Li POSIX
735ef6c7764STim J. Robbinslocale),
736208691fcSRuslan Ermilovthe command is not executed and the
737208691fcSRuslan Ermilovvalue of the
738208691fcSRuslan Ermilov.Ic -ok
739208691fcSRuslan Ermilovexpression is false.
740c93e83feSRuslan Ermilov.It Ic -okdir Ar utility Oo Ar argument ... Oc Li \&;
741208691fcSRuslan ErmilovThe
742208691fcSRuslan Ermilov.Ic -okdir
743208691fcSRuslan Ermilovprimary is identical to the
744208691fcSRuslan Ermilov.Ic -execdir
745208691fcSRuslan Ermilovprimary with the same exception as described for the
746208691fcSRuslan Ermilov.Ic -ok
747208691fcSRuslan Ermilovprimary.
7489b50d902SRodney W. Grimes.It Ic -path Ar pattern
7499b50d902SRodney W. GrimesTrue if the pathname being examined matches
7509b50d902SRodney W. Grimes.Ar pattern .
751bfd12208SRuslan ErmilovSpecial shell pattern matching characters
752bfd12208SRuslan Ermilov.Dq ( Li \&[ ,
753bfd12208SRuslan Ermilov.Dq Li \&] ,
754bfd12208SRuslan Ermilov.Dq Li * ,
755bfd12208SRuslan Ermilovand
756bfd12208SRuslan Ermilov.Dq Li \&? )
7579b50d902SRodney W. Grimesmay be used as part of
7589b50d902SRodney W. Grimes.Ar pattern .
7599b50d902SRodney W. GrimesThese characters may be matched explicitly by escaping them with a
760bfd12208SRuslan Ermilovbackslash
761bfd12208SRuslan Ermilov.Pq Dq Li \e .
762bfd12208SRuslan ErmilovSlashes
763bfd12208SRuslan Ermilov.Pq Dq Li /
764bfd12208SRuslan Ermilovare treated as normal characters and do not have to be
7659b50d902SRodney W. Grimesmatched explicitly.
7662a121b97SRicardo Branco.It Ic -perm Oo Cm - Ns | Ns Cm + Ns | Ns Cm / Oc Ns Ar mode
7679b50d902SRodney W. GrimesThe
7689b50d902SRodney W. Grimes.Ar mode
7699b50d902SRodney W. Grimesmay be either symbolic (see
7709b50d902SRodney W. Grimes.Xr chmod 1 )
7719b50d902SRodney W. Grimesor an octal number.
7727fd5ee41SRuslan ErmilovIf the
7737fd5ee41SRuslan Ermilov.Ar mode
7747fd5ee41SRuslan Ermilovis symbolic, a starting value of zero is assumed and the
7757fd5ee41SRuslan Ermilov.Ar mode
7767fd5ee41SRuslan Ermilovsets or clears permissions without regard to the process' file mode
7779b50d902SRodney W. Grimescreation mask.
7787fd5ee41SRuslan ErmilovIf the
7797fd5ee41SRuslan Ermilov.Ar mode
7807fd5ee41SRuslan Ermilovis octal, only bits 07777
781bfd12208SRuslan Ermilov.Pq Dv S_ISUID | S_ISGID | S_ISTXT | S_IRWXU | S_IRWXG | S_IRWXO
7829b50d902SRodney W. Grimesof the file's mode bits participate
7839b50d902SRodney W. Grimesin the comparison.
7847fd5ee41SRuslan ErmilovIf the
7857fd5ee41SRuslan Ermilov.Ar mode
7867fd5ee41SRuslan Ermilovis preceded by a dash
787bfd12208SRuslan Ermilov.Pq Dq Li - ,
7889b88faecSRuslan Ermilovthis primary evaluates to true
7897fd5ee41SRuslan Ermilovif at least all of the bits in the
7907fd5ee41SRuslan Ermilov.Ar mode
7917fd5ee41SRuslan Ermilovare set in the file's mode bits.
7927fd5ee41SRuslan ErmilovIf the
7937fd5ee41SRuslan Ermilov.Ar mode
7947fd5ee41SRuslan Ermilovis preceded by a plus
7952a121b97SRicardo Branco.Pq Dq Li +
7969b88faecSRuslan Ermilovthis primary evaluates to true
7977fd5ee41SRuslan Ermilovif any of the bits in the
7987fd5ee41SRuslan Ermilov.Ar mode
7997fd5ee41SRuslan Ermilovare set in the file's mode bits.
8002a121b97SRicardo BrancoA slash
8012a121b97SRicardo Branco.Pq Dq Li /
8022a121b97SRicardo Brancois also accepted with the same meaning as plus for compatibility with GNU find.
8039d2796c3SOllivier RobertOtherwise, this primary evaluates to true if
8047fd5ee41SRuslan Ermilovthe bits in the
8057fd5ee41SRuslan Ermilov.Ar mode
8067fd5ee41SRuslan Ermilovexactly match the file's mode bits.
807bfd12208SRuslan ErmilovNote, the first character of a symbolic mode may not be a dash
808bfd12208SRuslan Ermilov.Pq Dq Li - .
8099b50d902SRodney W. Grimes.It Ic -print
8109b50d902SRodney W. GrimesThis primary always evaluates to true.
8119b50d902SRodney W. GrimesIt prints the pathname of the current file to standard output.
812841484cdSPeter WemmIf none of
813bfd12208SRuslan Ermilov.Ic -exec , -ls , -print0 ,
8149b50d902SRodney W. Grimesor
815bfd12208SRuslan Ermilov.Ic -ok
816841484cdSPeter Wemmis specified, the given expression shall be effectively replaced by
817bfd12208SRuslan Ermilov.Cm \&( Ar "given expression" Cm \&) Ic -print .
8187cd23434SGarrett Wollman.It Ic -print0
8197cd23434SGarrett WollmanThis primary always evaluates to true.
820fbe0d04aSMasafumi Max NAKANEIt prints the pathname of the current file to standard output, followed by an
82193b8510cSGordon BerglingASCII
822cb29445aSRuslan Ermilov.Dv NUL
8237cd23434SGarrett Wollmancharacter (character code 0).
8249b50d902SRodney W. Grimes.It Ic -prune
8259b50d902SRodney W. GrimesThis primary always evaluates to true.
8269b50d902SRodney W. GrimesIt causes
8278fe908efSRuslan Ermilov.Nm
8289b50d902SRodney W. Grimesto not descend into the current file.
8299b50d902SRodney W. GrimesNote, the
8309b50d902SRodney W. Grimes.Ic -prune
8319b50d902SRodney W. Grimesprimary has no effect if the
8329b50d902SRodney W. Grimes.Fl d
8339b50d902SRodney W. Grimesoption was specified.
8349168a75aSDag-Erling Smørgrav.It Ic -quit
8359168a75aSDag-Erling SmørgravCauses
8369168a75aSDag-Erling Smørgrav.Nm
837b547523eSJilles Tjoelkerto terminate immediately.
838e4b646ceSRicardo Branco.It Ic -readable
839e4b646ceSRicardo BrancoMatches files which are readable by the current user.
840e4b646ceSRicardo BrancoThis test makes use of the
841e4b646ceSRicardo Branco.Xr access 2
842e4b646ceSRicardo Brancosystem call, and so can be fooled by NFS servers which do UID mapping (or root-squashing).
843e4b646ceSRicardo BrancoThis is a GNU find extension.
844208691fcSRuslan Ermilov.It Ic -regex Ar pattern
845208691fcSRuslan ErmilovTrue if the whole path of the file matches
846208691fcSRuslan Ermilov.Ar pattern
847208691fcSRuslan Ermilovusing regular expression.
848208691fcSRuslan ErmilovTo match a file named
849208691fcSRuslan Ermilov.Dq Pa ./foo/xyzzy ,
850208691fcSRuslan Ermilovyou can use the regular expression
851208691fcSRuslan Ermilov.Dq Li ".*/[xyz]*"
852208691fcSRuslan Ermilovor
853208691fcSRuslan Ermilov.Dq Li ".*/foo/.*" ,
854208691fcSRuslan Ermilovbut not
855208691fcSRuslan Ermilov.Dq Li xyzzy
856208691fcSRuslan Ermilovor
857208691fcSRuslan Ermilov.Dq Li /foo/ .
85846b993ffSWarner Losh.It Ic -samefile Ar name
85946b993ffSWarner LoshTrue if the file is a hard link to
86046b993ffSWarner Losh.Ar name .
86146b993ffSWarner LoshIf the command option
86246b993ffSWarner Losh.Ic -L
86346b993ffSWarner Loshis specified, it is also true if the file is a symbolic link and
86446b993ffSWarner Loshpoints to
86546b993ffSWarner Losh.Ar name .
8665a890aacSKirill Ponomarev.It Ic -size Ar n Ns Op Cm ckMGTP
86754874bb6SRuslan ErmilovTrue if the file's size, rounded up, in 512-byte blocks is
8689b50d902SRodney W. Grimes.Ar n .
8699b50d902SRodney W. GrimesIf
8709b50d902SRodney W. Grimes.Ar n
871bfd12208SRuslan Ermilovis followed by a
872bfd12208SRuslan Ermilov.Cm c ,
873bfd12208SRuslan Ermilovthen the primary is true if the
8749b50d902SRodney W. Grimesfile's size is
8759b50d902SRodney W. Grimes.Ar n
876bfd12208SRuslan Ermilovbytes (characters).
8775a890aacSKirill PonomarevSimilarly if
8785a890aacSKirill Ponomarev.Ar n
8795a890aacSKirill Ponomarevis followed by a scale indicator then the file's size is compared to
8805a890aacSKirill Ponomarev.Ar n
8815a890aacSKirill Ponomarevscaled as:
8825a890aacSKirill Ponomarev.Pp
8835a890aacSKirill Ponomarev.Bl -tag -width indent -compact
8845a890aacSKirill Ponomarev.It Cm k
8855a890aacSKirill Ponomarevkilobytes (1024 bytes)
8865a890aacSKirill Ponomarev.It Cm M
8875a890aacSKirill Ponomarevmegabytes (1024 kilobytes)
8885a890aacSKirill Ponomarev.It Cm G
8895a890aacSKirill Ponomarevgigabytes (1024 megabytes)
8905a890aacSKirill Ponomarev.It Cm T
8915a890aacSKirill Ponomarevterabytes (1024 gigabytes)
8925a890aacSKirill Ponomarev.It Cm P
8935a890aacSKirill Ponomarevpetabytes (1024 terabytes)
8945a890aacSKirill Ponomarev.El
8959ed0c92cSDavid Malone.It Ic -sparse
8969ed0c92cSDavid MaloneTrue if the current file is sparse,
8979ed0c92cSDavid Malonei.e. has fewer blocks allocated than expected based on its size in bytes.
8989ed0c92cSDavid MaloneThis might also match files that have been compressed by the filesystem.
8999b50d902SRodney W. Grimes.It Ic -type Ar t
9009b50d902SRodney W. GrimesTrue if the file is of the specified type.
9019b50d902SRodney W. GrimesPossible file types are as follows:
9029b50d902SRodney W. Grimes.Pp
903bfd12208SRuslan Ermilov.Bl -tag -width indent -compact
9049b50d902SRodney W. Grimes.It Cm b
9059b50d902SRodney W. Grimesblock special
9069b50d902SRodney W. Grimes.It Cm c
9079b50d902SRodney W. Grimescharacter special
9089b50d902SRodney W. Grimes.It Cm d
9099b50d902SRodney W. Grimesdirectory
9109b50d902SRodney W. Grimes.It Cm f
9119b50d902SRodney W. Grimesregular file
9129b50d902SRodney W. Grimes.It Cm l
9139b50d902SRodney W. Grimessymbolic link
9149b50d902SRodney W. Grimes.It Cm p
9159b50d902SRodney W. GrimesFIFO
9169b50d902SRodney W. Grimes.It Cm s
9179b50d902SRodney W. Grimessocket
9189b50d902SRodney W. Grimes.El
91946b993ffSWarner Losh.It Ic -uid Ar uname
92046b993ffSWarner LoshThe same thing as
92146b993ffSWarner Losh.Ar -user Ar uname
92246b993ffSWarner Loshfor compatibility with GNU find.
92346b993ffSWarner LoshGNU find imposes a restriction that
92446b993ffSWarner Losh.Ar uname
92546b993ffSWarner Loshis numeric, while
92681b295a1SEitan Adler.Nm
92746b993ffSWarner Loshdoes not.
9289b50d902SRodney W. Grimes.It Ic -user Ar uname
9299b50d902SRodney W. GrimesTrue if the file belongs to the user
9309b50d902SRodney W. Grimes.Ar uname .
9319b50d902SRodney W. GrimesIf
9329b50d902SRodney W. Grimes.Ar uname
9339b50d902SRodney W. Grimesis numeric and there is no such user name, then
9349b50d902SRodney W. Grimes.Ar uname
935bfd12208SRuslan Ermilovis treated as a user ID.
93646b993ffSWarner Losh.It Ic -wholename Ar pattern
93746b993ffSWarner LoshThe same thing as
93846b993ffSWarner Losh.Ic -path ,
93946b993ffSWarner Loshfor GNU find compatibility.
940e4b646ceSRicardo Branco.It Ic -writable
941e4b646ceSRicardo BrancoMatches files which are writable by the current user.
942e4b646ceSRicardo BrancoThis test makes use of the
943e4b646ceSRicardo Branco.Xr access 2
944e4b646ceSRicardo Brancosystem call, and so can be fooled by NFS servers which do UID mapping (or root-squashing).
945e4b646ceSRicardo BrancoThis is a GNU find extension.
9469b50d902SRodney W. Grimes.El
9479b50d902SRodney W. Grimes.Sh OPERATORS
9489b50d902SRodney W. GrimesThe primaries may be combined using the following operators.
9499b50d902SRodney W. GrimesThe operators are listed in order of decreasing precedence.
950bfd12208SRuslan Ermilov.Pp
951fbccd9dbSRuslan Ermilov.Bl -tag -width indent -compact
9520c101fb2SJoseph Koshy.It Cm \&( Ar expression Cm \&)
9539b50d902SRodney W. GrimesThis evaluates to true if the parenthesized expression evaluates to
9549b50d902SRodney W. Grimestrue.
9559b50d902SRodney W. Grimes.Pp
9560c101fb2SJoseph Koshy.It Cm \&! Ar expression
9574a0193d3SJuli Mallett.It Cm -not Ar expression
9589b50d902SRodney W. GrimesThis is the unary
9599b50d902SRodney W. Grimes.Tn NOT
9609b50d902SRodney W. Grimesoperator.
9619b50d902SRodney W. GrimesIt evaluates to true if the expression is false.
9629b50d902SRodney W. Grimes.Pp
96346b993ffSWarner Losh.It Cm -false
96446b993ffSWarner LoshAlways false.
96546b993ffSWarner Losh.It Cm -true
96646b993ffSWarner LoshAlways true.
96746b993ffSWarner Losh.Pp
9689b50d902SRodney W. Grimes.It Ar expression Cm -and Ar expression
9699b50d902SRodney W. Grimes.It Ar expression expression
9709b50d902SRodney W. GrimesThe
9719b50d902SRodney W. Grimes.Cm -and
9729b50d902SRodney W. Grimesoperator is the logical
9739b50d902SRodney W. Grimes.Tn AND
9749b50d902SRodney W. Grimesoperator.
9759b50d902SRodney W. GrimesAs it is implied by the juxtaposition of two expressions it does not
9769b50d902SRodney W. Grimeshave to be specified.
9779b50d902SRodney W. GrimesThe expression evaluates to true if both expressions are true.
9789b50d902SRodney W. GrimesThe second expression is not evaluated if the first expression is false.
9799b50d902SRodney W. Grimes.Pp
9809b50d902SRodney W. Grimes.It Ar expression Cm -or Ar expression
9819b50d902SRodney W. GrimesThe
9829b50d902SRodney W. Grimes.Cm -or
9839b50d902SRodney W. Grimesoperator is the logical
9849b50d902SRodney W. Grimes.Tn OR
9859b50d902SRodney W. Grimesoperator.
9869b50d902SRodney W. GrimesThe expression evaluates to true if either the first or the second expression
9879b50d902SRodney W. Grimesis true.
9889b50d902SRodney W. GrimesThe second expression is not evaluated if the first expression is true.
9899b50d902SRodney W. Grimes.El
9909b50d902SRodney W. Grimes.Pp
9919b50d902SRodney W. GrimesAll operands and primaries must be separate arguments to
9928fe908efSRuslan Ermilov.Nm .
9939b50d902SRodney W. GrimesPrimaries which themselves take arguments expect each argument
9949b50d902SRodney W. Grimesto be a separate argument to
9958fe908efSRuslan Ermilov.Nm .
996ef6c7764STim J. Robbins.Sh ENVIRONMENT
997ef6c7764STim J. RobbinsThe
998ef6c7764STim J. Robbins.Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
999ef6c7764STim J. Robbinsand
1000ef6c7764STim J. Robbins.Ev LC_TIME
1001ef6c7764STim J. Robbinsenvironment variables affect the execution of the
1002ef6c7764STim J. Robbins.Nm
1003ef6c7764STim J. Robbinsutility as described in
1004ef6c7764STim J. Robbins.Xr environ 7 .
10059b50d902SRodney W. Grimes.Sh EXAMPLES
10069b50d902SRodney W. GrimesThe following examples are shown as given to the shell:
1007bfd12208SRuslan Ermilov.Bl -tag -width indent
10089b50d902SRodney W. Grimes.It Li "find / \e! -name \*q*.c\*q -print"
1009bfd12208SRuslan ErmilovPrint out a list of all the files whose names do not end in
1010bfd12208SRuslan Ermilov.Pa .c .
10119b50d902SRodney W. Grimes.It Li "find / -newer ttt -user wnj -print"
1012bfd12208SRuslan ErmilovPrint out a list of all the files owned by user
1013bfd12208SRuslan Ermilov.Dq wnj
1014bfd12208SRuslan Ermilovthat are newer
1015bfd12208SRuslan Ermilovthan the file
1016bfd12208SRuslan Ermilov.Pa ttt .
10179b50d902SRodney W. Grimes.It Li "find / \e! \e( -newer ttt -user wnj \e) -print"
1018bfd12208SRuslan ErmilovPrint out a list of all the files which are not both newer than
1019bfd12208SRuslan Ermilov.Pa ttt
1020bfd12208SRuslan Ermilovand owned by
1021bfd12208SRuslan Ermilov.Dq wnj .
10229b50d902SRodney W. Grimes.It Li "find / \e( -newer ttt -or -user wnj \e) -print"
1023bfd12208SRuslan ErmilovPrint out a list of all the files that are either owned by
1024bfd12208SRuslan Ermilov.Dq wnj
1025bfd12208SRuslan Ermilovor that are newer than
1026bfd12208SRuslan Ermilov.Pa ttt .
1027e578c242STom Rhodes.It Li "find / -newerct '1 minute ago' -print"
1028ea92232aSPoul-Henning KampPrint out a list of all the files whose inode change time is more
1029ea92232aSPoul-Henning Kamprecent than the current time minus one minute.
103054874bb6SRuslan Ermilov.It Li "find / -type f -exec echo {} \e;"
1031e578c242STom RhodesUse the
1032e578c242STom Rhodes.Xr echo 1
1033e578c242STom Rhodescommand to print out a list of all the files.
1034a05cb852SJilles Tjoelker.It Li "find -L /usr/ports/packages -type l -exec rm -- {} +"
10351c832963SOliver EikemeierDelete all broken symbolic links in
10361c832963SOliver Eikemeier.Pa /usr/ports/packages .
10371c832963SOliver Eikemeier.It Li "find /usr/src -name CVS -prune -o -depth +6 -print"
10381c832963SOliver EikemeierFind files and directories that are at least seven levels deep
10391c832963SOliver Eikemeierin the working directory
10401c832963SOliver Eikemeier.Pa /usr/src .
10411c832963SOliver Eikemeier.It Li "find /usr/src -name CVS -prune -o -mindepth 7 -print"
10421c832963SOliver EikemeierIs not equivalent to the previous example, since
10431c832963SOliver Eikemeier.Ic -prune
10441c832963SOliver Eikemeieris not evaluated below level seven.
10459b50d902SRodney W. Grimes.El
1046e578c242STom Rhodes.Sh COMPATIBILITY
1047e578c242STom RhodesThe
1048e578c242STom Rhodes.Ic -follow
104947d91ba3SDag-Erling Smørgravprimary is deprecated; the
105047d91ba3SDag-Erling Smørgrav.Fl L
105147d91ba3SDag-Erling Smørgravoption should be used instead.
105247d91ba3SDag-Erling SmørgravSee the
105347d91ba3SDag-Erling Smørgrav.Sx STANDARDS
105447d91ba3SDag-Erling Smørgravsection below for details.
10559b50d902SRodney W. Grimes.Sh SEE ALSO
1056567664c4SOllivier Robert.Xr chflags 1 ,
10579b50d902SRodney W. Grimes.Xr chmod 1 ,
10589b50d902SRodney W. Grimes.Xr locate 1 ,
1059d740b7c7SPawel Jakub Dawidek.Xr lsvfs 1 ,
106041cbb624SJoseph Koshy.Xr whereis 1 ,
106141cbb624SJoseph Koshy.Xr which 1 ,
1062a8d50686STom Rhodes.Xr xargs 1 ,
10639b50d902SRodney W. Grimes.Xr stat 2 ,
106453e87059STom Rhodes.Xr acl 3 ,
10659b50d902SRodney W. Grimes.Xr fts 3 ,
10669b50d902SRodney W. Grimes.Xr getgrent 3 ,
10679b50d902SRodney W. Grimes.Xr getpwent 3 ,
10689b50d902SRodney W. Grimes.Xr strmode 3 ,
106993b8510cSGordon Bergling.Xr ascii 7 ,
107094ad6032SRuslan Ermilov.Xr re_format 7 ,
10719b50d902SRodney W. Grimes.Xr symlink 7
10729b50d902SRodney W. Grimes.Sh STANDARDS
10739b50d902SRodney W. GrimesThe
10748fe908efSRuslan Ermilov.Nm
10759b50d902SRodney W. Grimesutility syntax is a superset of the syntax specified by the
10761c832963SOliver Eikemeier.St -p1003.1-2001
10779b50d902SRodney W. Grimesstandard.
10789b50d902SRodney W. Grimes.Pp
10791c832963SOliver EikemeierAll the single character options except
1080fbccd9dbSRuslan Ermilov.Fl H
10811c832963SOliver Eikemeierand
1082fbccd9dbSRuslan Ermilov.Fl L
1083659a728eSCeri Daviesas well as
1084659a728eSCeri Davies.Ic -amin , -anewer , -cmin , -cnewer , -delete , -empty , -fstype ,
1085659a728eSCeri Davies.Ic -iname , -inum , -iregex , -ls , -maxdepth , -mindepth , -mmin ,
108675e6f664SDaniel Ebdrup Jensen.Ic -not , -path , -print0 , -regex , -sparse
1087440a24d8SCeri Daviesand all of the
108875e6f664SDaniel Ebdrup Jensen.Fl B*
1089440a24d8SCeri Daviesbirthtime related primaries are extensions to
10901c832963SOliver Eikemeier.St -p1003.1-2001 .
1091f6e4fb22SSteve Price.Pp
10929b50d902SRodney W. GrimesHistorically, the
109347d91ba3SDag-Erling Smørgrav.Fl d , L
10949b50d902SRodney W. Grimesand
10959b50d902SRodney W. Grimes.Fl x
1096bfd12208SRuslan Ermilovoptions were implemented using the primaries
1097bfd12208SRuslan Ermilov.Ic -depth , -follow ,
1098bfd12208SRuslan Ermilovand
1099bfd12208SRuslan Ermilov.Ic -xdev .
11009b50d902SRodney W. GrimesThese primaries always evaluated to true.
11019b50d902SRodney W. GrimesAs they were really global variables that took effect before the traversal
11029b50d902SRodney W. Grimesbegan, some legal expressions could have unexpected results.
1103bfd12208SRuslan ErmilovAn example is the expression
1104bfd12208SRuslan Ermilov.Ic -print Cm -o Ic -depth .
1105bfd12208SRuslan ErmilovAs
1106bfd12208SRuslan Ermilov.Ic -print
1107bfd12208SRuslan Ermilovalways evaluates to true, the standard order of evaluation
1108bfd12208SRuslan Ermilovimplies that
1109bfd12208SRuslan Ermilov.Ic -depth
1110bfd12208SRuslan Ermilovwould never be evaluated.
11119b50d902SRodney W. GrimesThis is not the case.
11129b50d902SRodney W. Grimes.Pp
1113bfd12208SRuslan ErmilovThe operator
1114bfd12208SRuslan Ermilov.Cm -or
1115bfd12208SRuslan Ermilovwas implemented as
1116bfd12208SRuslan Ermilov.Cm -o ,
1117bfd12208SRuslan Ermilovand the operator
1118bfd12208SRuslan Ermilov.Cm -and
1119bfd12208SRuslan Ermilovwas implemented as
1120bfd12208SRuslan Ermilov.Cm -a .
11219b50d902SRodney W. Grimes.Pp
11229b50d902SRodney W. GrimesHistoric implementations of the
1123bfd12208SRuslan Ermilov.Ic -exec
11249b50d902SRodney W. Grimesand
1125bfd12208SRuslan Ermilov.Ic -ok
1126bfd12208SRuslan Ermilovprimaries did not replace the string
1127bfd12208SRuslan Ermilov.Dq Li {}
1128bfd12208SRuslan Ermilovin the utility name or the
11299b50d902SRodney W. Grimesutility arguments if it had preceding or following non-whitespace characters.
11309b50d902SRodney W. GrimesThis version replaces it no matter where in the utility name or arguments
11319b50d902SRodney W. Grimesit appears.
11327c1d4b3aSAkinori MUSHA.Pp
11337c1d4b3aSAkinori MUSHAThe
11347c1d4b3aSAkinori MUSHA.Fl E
113547d91ba3SDag-Erling Smørgravoption was inspired by the equivalent
11367c1d4b3aSAkinori MUSHA.Xr grep 1
11377c1d4b3aSAkinori MUSHAand
113847d91ba3SDag-Erling Smørgrav.Xr sed 1
113947d91ba3SDag-Erling Smørgravoptions.
11402a121b97SRicardo Branco.Pp
11412a121b97SRicardo BrancoThe
11422a121b97SRicardo Branco.Ic -perm
11432a121b97SRicardo Brancoprimary accepts a leading slash
11442a121b97SRicardo Branco.Pq Dq Li /
11452a121b97SRicardo Brancoas an alias for a leading plus
11462a121b97SRicardo Branco.Pq Dq Li +
11472a121b97SRicardo Brancofor its argument as an extension of
11482a121b97SRicardo Branco.St -p1003.1-2001
11492a121b97SRicardo Brancoto be compatible with GNU find.
1150ad487600SColin Percival.Sh HISTORY
1151a9275d99SGordon BerglingA simple
1152ad487600SColin Percival.Nm
1153ad487600SColin Percivalcommand appeared in
1154a9275d99SGordon Bergling.At v1
1155a9275d99SGordon Berglingand was removed in
1156a9275d99SGordon Bergling.At v3 .
1157a9275d99SGordon BerglingIt was rewritten for
1158a9275d99SGordon Bergling.At v5
1159a9275d99SGordon Berglingand later be enhanced for the Programmer's Workbench (PWB).
1160a9275d99SGordon BerglingThese changes were later incorporated in
1161a9275d99SGordon Bergling.At v7 .
11629b50d902SRodney W. Grimes.Sh BUGS
11639b50d902SRodney W. GrimesThe special characters used by
11648fe908efSRuslan Ermilov.Nm
11659b50d902SRodney W. Grimesare also special characters to many shell programs.
1166bfd12208SRuslan ErmilovIn particular, the characters
1167bfd12208SRuslan Ermilov.Dq Li * ,
1168bfd12208SRuslan Ermilov.Dq Li \&[ ,
1169bfd12208SRuslan Ermilov.Dq Li \&] ,
1170bfd12208SRuslan Ermilov.Dq Li \&? ,
1171bfd12208SRuslan Ermilov.Dq Li \&( ,
1172bfd12208SRuslan Ermilov.Dq Li \&) ,
1173bfd12208SRuslan Ermilov.Dq Li \&! ,
1174bfd12208SRuslan Ermilov.Dq Li \e
1175bfd12208SRuslan Ermilovand
1176bfd12208SRuslan Ermilov.Dq Li \&;
1177bfd12208SRuslan Ermilovmay have to be escaped from the shell.
11789b50d902SRodney W. Grimes.Pp
11799b50d902SRodney W. GrimesAs there is no delimiter separating options and file names or file
11809b50d902SRodney W. Grimesnames and the
11819b50d902SRodney W. Grimes.Ar expression ,
1182bfd12208SRuslan Ermilovit is difficult to specify files named
1183bfd12208SRuslan Ermilov.Pa -xdev
1184bfd12208SRuslan Ermilovor
1185bfd12208SRuslan Ermilov.Pa \&! .
11869b50d902SRodney W. GrimesThese problems are handled by the
11879b50d902SRodney W. Grimes.Fl f
11889b50d902SRodney W. Grimesoption and the
11899b50d902SRodney W. Grimes.Xr getopt 3
1190bfd12208SRuslan Ermilov.Dq Fl Fl
1191bfd12208SRuslan Ermilovconstruct.
1192abacbbbfSPeter Wemm.Pp
1193abacbbbfSPeter WemmThe
1194abacbbbfSPeter Wemm.Ic -delete
119556f7a840SBill Fumerolaprimary does not interact well with other options that cause the file system
1196abacbbbfSPeter Wemmtree traversal options to be changed.
1197ad487600SColin Percival.Pp
11984f45d811STim J. RobbinsThe
1199dfef91e9SColin Percival.Ic -mindepth
1200dfef91e9SColin Percivaland
1201dfef91e9SColin Percival.Ic -maxdepth
12022cb640f6SColin Percivalprimaries are actually global options (as documented above).
12032cb640f6SColin PercivalThey should
1204dfef91e9SColin Percivalprobably be replaced by options which look like options.
1205