]> git.saurik.com Git - apple/shell_cmds.git/blame - find/find.1
shell_cmds-81.1.tar.gz
[apple/shell_cmds.git] / find / find.1
CommitLineData
44bd5ea7
A
1.\" The Regents of the University of California. All rights reserved.
2.\"
3.\" This code is derived from software contributed to Berkeley by
4.\" the Institute of Electrical and Electronics Engineers, Inc.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\" must display the following acknowledgement:
16.\" This product includes software developed by the University of
17.\" California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\" may be used to endorse or promote products derived from this software
20.\" without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
c0fcf4e1
A
34.\" @(#)find.1 8.7 (Berkeley) 5/9/95
35.\" $FreeBSD: src/usr.bin/find/find.1,v 1.23.2.14 2001/12/14 15:53:30 ru Exp $
44bd5ea7 36.\"
c0fcf4e1 37.Dd May 3, 2001
44bd5ea7
A
38.Dt FIND 1
39.Os
40.Sh NAME
41.Nm find
42.Nd walk a file hierarchy
43.Sh SYNOPSIS
c0fcf4e1 44.Nm
44bd5ea7 45.Op Fl H | Fl L | Fl P
c0fcf4e1
A
46.Op Fl EXdsx
47.Op Fl f Ar pathname
48.Op Ar pathname ...
44bd5ea7
A
49.Ar expression
50.Sh DESCRIPTION
c0fcf4e1 51.Nm Find
44bd5ea7 52recursively descends the directory tree for each
c0fcf4e1 53.Ar pathname
44bd5ea7
A
54listed, evaluating an
55.Ar expression
c0fcf4e1
A
56(composed of the
57.Dq primaries
58and
59.Dq operands
60listed below) in terms
44bd5ea7
A
61of each file in the tree.
62.Pp
63The options are as follows:
c0fcf4e1
A
64.Bl -tag -width indent
65.It Fl E
66Interpret regular expressions followed by
67.Ic -regex
68and
69.Ic -iregex
70options as extended (modern) regular expressions rather than basic
71regular expressions (BRE's).
72The
73.Xr re_format 7
74manual page fully describes both formats.
44bd5ea7
A
75.It Fl H
76The
77.Fl H
78option causes the file information and file type (see
c0fcf4e1
A
79.Xr stat 2 )
80returned for each symbolic link specified on the command line to be
44bd5ea7
A
81those of the file referenced by the link, not the link itself.
82If the referenced file does not exist, the file information and type will
c0fcf4e1
A
83be for the link itself.
84File information of all symbolic links not on
44bd5ea7
A
85the command line is that of the link itself.
86.It Fl L
87The
88.Fl L
89option causes the file information and file type (see
c0fcf4e1 90.Xr stat 2 )
44bd5ea7
A
91returned for each symbolic link to be those of the file referenced by the
92link, not the link itself.
93If the referenced file does not exist, the file information and type will
94be for the link itself.
95.It Fl P
96The
97.Fl P
98option causes the file information and file type (see
c0fcf4e1 99.Xr stat 2 )
44bd5ea7 100returned for each symbolic link to be those of the link itself.
c0fcf4e1 101This is the default.
44bd5ea7
A
102.It Fl X
103The
104.Fl X
105option is a modification to permit
106.Nm
107to be safely used in conjunction with
108.Xr xargs 1 .
109If a file name contains any of the delimiting characters used by
c0fcf4e1 110.Xr xargs 1 ,
44bd5ea7
A
111a diagnostic message is displayed on standard error, and the file
112is skipped.
c0fcf4e1
A
113The delimiting characters include single
114.Pq Dq Li " ' "
115and double
116.Pq Dq Li " \*q "
117quotes, backslash
118.Pq Dq Li \e ,
119space, tab and newline characters.
44bd5ea7
A
120.It Fl d
121The
122.Fl d
123option causes
124.Nm
c0fcf4e1 125to perform a depth\-first traversal, i.e., directories
44bd5ea7
A
126are visited in post\-order and all entries in a directory will be acted
127on before the directory itself.
128By default,
129.Nm
c0fcf4e1 130visits directories in pre\-order, i.e., before their contents.
44bd5ea7 131Note, the default is
c0fcf4e1 132.Em not
44bd5ea7
A
133a breadth\-first traversal.
134.It Fl f
135The
136.Fl f
137option specifies a file hierarchy for
138.Nm
139to traverse.
140File hierarchies may also be specified as the operands immediately
141following the options.
c0fcf4e1 142.It Fl s
44bd5ea7 143The
c0fcf4e1
A
144.Fl s
145option causes
146.Nm
147to traverse the file hierarchies in lexicographical order,
148i.e., alphabetical order within each directory.
149Note:
150.Ql find -s
151and
152.Ql "find | sort"
153may give different results.
44bd5ea7
A
154.It Fl x
155The
156.Fl x
157option prevents
158.Nm
159from descending into directories that have a device number different
160than that of the file from which the descent began.
161.El
162.Sh PRIMARIES
c0fcf4e1
A
163.Bl -tag -width indent
164.It Ic -amin Ar n
165True if the difference between the file last access time and the time
166.Nm
167was started, rounded up to the next full minute, is
168.Ar n
169minutes.
170.It Ic -anewer Ar file
171Same as
172.Ic -neweram .
173.It Ic -atime Ar n
44bd5ea7
A
174True if the difference between the file last access time and the time
175.Nm
176was started, rounded up to the next full 24\-hour period, is
177.Ar n
17824\-hour periods.
c0fcf4e1
A
179.It Ic -cmin Ar n
180True if the difference between the time of last change of file status
181information and the time
182.Nm
183was started, rounded up to the next full minute, is
184.Ar n
185minutes.
186.It Ic -cnewer Ar file
187Same as
188.Ic -newercm .
189.It Ic -ctime Ar n
44bd5ea7
A
190True if the difference between the time of last change of file status
191information and the time
192.Nm
193was started, rounded up to the next full 24\-hour period, is
194.Ar n
19524\-hour periods.
c0fcf4e1
A
196.It Ic -delete
197Delete found files and/or directories.
198Always returns true.
199This executes
200from the current working directory as
201.Nm
202recurses down the tree.
203It will not attempt to delete a filename with a
204.Dq Pa /
205character in its pathname relative to
206.Dq Pa \&.
207for security reasons.
208Depth\-first traversal processing is implied by this option.
209.It Ic -depth
210Always true;
211same as the
212.Fl d
213option.
214.Ic -depth
215can be useful when
216.Nm
217is used with
218.Xr cpio 1
219to process files that are contained in directories with unusual permissions.
220It enures that you have write permission while you are placing files in a
221directory, then sets the directory's permissions as the last thing.
222.It Ic -empty
223True if the current file or directory is empty.
224.It Ic -exec Ar utility Op Ar argument ... ;
44bd5ea7
A
225True if the program named
226.Ar utility
227returns a zero value as its exit status.
c0fcf4e1
A
228Optional
229.Ar arguments
230may be passed to the utility.
231The expression must be terminated by a semicolon
232.Pq Dq Li \&; .
233If the string
234.Dq Li {}
235appears anywhere in the utility name or the
44bd5ea7
A
236arguments it is replaced by the pathname of the current file.
237.Ar Utility
238will be executed from the directory from which
239.Nm
240was executed.
c0fcf4e1
A
241.Ar Utility
242and
243.Ar arguments
244are not subject to the further expansion of shell patterns
245and constructs.
246.It Ic -execdir Ar utility Op Ar argument ... ;
247The
248.Ic -execdir
249primary is identical to the
250.Ic -exec
251primary with the exception that
252.Ar utility
253will be executed from the directory that holds
254the current file.
255The filename substituted for
256the string
257.Dq Li {}
258is not qualified.
259.It Ic -flags Oo Cm - Ns | Ns Cm + Oc Ns Ar flags , Ns Ar notflags
260The flags are specified using symbolic names (see
261.Xr chflags 1 ) .
262Those with the
263.Qq Li no
264prefix (except
265.Qq Li nodump )
266are said to be
267.Ar notflags .
268Flags in
269.Ar flags
270are checked to be set, and flags in
271.Ar notflags
272are checked to be not set.
273Note that this is different from
274.Ic -perm ,
275which only allows the user to specify mode bits that are set.
276.Pp
277If flags are preceded by a dash
278.Pq Dq Li - ,
279this primary evaluates to true
280if at least all of the bits in
281.Ar flags
282and none of the bits in
283.Ar notflags
284are set in the file's flags bits.
285If flags are preceded by a plus
286.Pq Dq Li + ,
287this primary evaluates to true
288if any of the bits in
289.Ar flags
290is set in the file's flags bits,
291or any of the bits in
292.Ar notflags
293is not set in the file's flags bits.
294Otherwise,
295this primary evaluates to true
296if the bits in
297.Ar flags
298exactly match the file's flags bits,
299and none of the
300.Ar flags
301bits match those of
302.Ar notflags .
303.It Ic -fstype Ar type
44bd5ea7
A
304True if the file is contained in a file system of type
305.Ar type .
306The
307.Xr sysctl 8
308command can be used to find out the types of filesystems
309that are available on the system:
c0fcf4e1
A
310.Pp
311.Dl "sysctl vfs"
312.Pp
313In addition, there are two pseudo-types,
314.Dq Li local
315and
316.Dq Li rdonly .
44bd5ea7
A
317The former matches any file system physically mounted on the system where
318the
319.Nm
c0fcf4e1 320is being executed and the latter matches any file system which is
44bd5ea7 321mounted read-only.
c0fcf4e1 322.It Ic -group Ar gname
44bd5ea7 323True if the file belongs to the group
c0fcf4e1 324.Ar gname .
44bd5ea7
A
325If
326.Ar gname
327is numeric and there is no such group name, then
328.Ar gname
c0fcf4e1
A
329is treated as a group ID.
330.It Ic -iname Ar pattern
331Like
332.Ic -name ,
333but the match is case insensitive.
334.It Ic -inum Ar n
44bd5ea7 335True if the file has inode number
c0fcf4e1
A
336.Ar n .
337.It Ic -ipath Ar pattern
338Like
339.Ic -path ,
340but the match is case insensitive.
341.It Ic -iregex Ar pattern
342Like
343.Ic -regex ,
344but the match is case insensitive.
345.It Ic -links Ar n
44bd5ea7
A
346True if the file has
347.Ar n
348links.
349.It Ic -ls
350This primary always evaluates to true.
351The following information for the current file is written to standard output:
352its inode number, size in 512\-byte blocks, file permissions, number of hard
353links, owner, group, size in bytes, last modification time, and pathname.
354If the file is a block or character special file, the major and minor numbers
355will be displayed instead of the size in bytes.
356If the file is a symbolic link, the pathname of the linked\-to file will be
c0fcf4e1
A
357displayed preceded by
358.Dq Li -> .
359The format is identical to that produced by
360.Bk -words
361.Nm ls Fl dgils .
362.Ek
363.It Ic -maxdepth Ar n
364True if the depth of the current file into the tree is less than or equal to
365.Ar n .
366.It Ic -mindepth Ar n
367True if the depth of the current file into the tree is greater than or equal to
368.Ar n .
369.It Ic -mmin Ar n
370True if the difference between the file last modification time and the time
371.Nm
372was started, rounded up to the next full minute, is
373.Ar n
374minutes.
375.It Ic -mnewer Ar file
376Same as
377.Ic -newer .
378.It Ic -mtime Ar n
44bd5ea7
A
379True if the difference between the file last modification time and the time
380.Nm
381was started, rounded up to the next full 24\-hour period, is
382.Ar n
38324\-hour periods.
c0fcf4e1
A
384.It Ic -name Ar pattern
385True if the last component of the pathname being examined matches
386.Ar pattern .
387Special shell pattern matching characters
388.Dq ( Li \&[ ,
389.Dq Li \&] ,
390.Dq Li * ,
391and
392.Dq Li \&? )
393may be used as part of
394.Ar pattern .
395These characters may be matched explicitly by escaping them with a
396backslash
397.Pq Dq Li \e .
398.It Ic -newer Ar file
399True if the current file has a more recent last modification time than
400.Ar file .
401.It Ic -newer Ns Ar X Ns Ar Y Ar file
402True if the current file has a more recent last access time
403.Ar ( X Ns = Ns Cm a ) ,
404change time
405.Ar ( X Ns = Ns Cm c ) ,
406or modification time
407.Ar ( X Ns = Ns Cm m )
408than the last access time
409.Ar ( Y Ns = Ns Cm a ) ,
410change time
411.Ar ( Y Ns = Ns Cm c ) ,
412or modification time
413.Ar ( Y Ns = Ns Cm m )
414of
415.Ar file .
416In addition, if
417.Ar Y Ns = Ns Cm t ,
418then
419.Ar file
420is instead interpreted as a direct date specification of the form
421understood by
422.Xr cvs 1 .
423Note that
424.Ic -newermm
425is equivalent to
426.Ic -newer .
427.It Ic -nogroup
428True if the file belongs to an unknown group.
429.It Ic -nouser
430True if the file belongs to an unknown user.
431.It Ic -ok Ar utility Op Ar argument ... ;
44bd5ea7 432The
c0fcf4e1 433.Ic -ok
44bd5ea7
A
434primary is identical to the
435.Ic -exec
436primary with the exception that
437.Nm
c0fcf4e1
A
438requests user affirmation for the execution of the
439.Ar utility
440by printing
44bd5ea7 441a message to the terminal and reading a response.
c0fcf4e1
A
442If the response is other than
443.Dq Li y
444the command is not executed and the
44bd5ea7 445value of the
c0fcf4e1 446.Ic -ok
44bd5ea7 447expression is false.
c0fcf4e1
A
448.It Ic -okdir Ar utility Op Ar argument ... ;
449The
450.Ic -okdir
451primary is identical to the
452.Ic -execdir
453primary with the same exception as described for the
454.Ic -ok
455primary.
456.It Ic -path Ar pattern
44bd5ea7 457True if the pathname being examined matches
c0fcf4e1
A
458.Ar pattern .
459Special shell pattern matching characters
460.Dq ( Li \&[ ,
461.Dq Li \&] ,
462.Dq Li * ,
463and
464.Dq Li \&? )
44bd5ea7 465may be used as part of
c0fcf4e1 466.Ar pattern .
44bd5ea7 467These characters may be matched explicitly by escaping them with a
c0fcf4e1
A
468backslash
469.Pq Dq Li \e .
470Slashes
471.Pq Dq Li /
472are treated as normal characters and do not have to be
44bd5ea7 473matched explicitly.
c0fcf4e1 474.It Ic -perm Oo Cm - Ns | Ns Cm + Oc Ns Ar mode
44bd5ea7
A
475The
476.Ar mode
477may be either symbolic (see
c0fcf4e1 478.Xr chmod 1 )
44bd5ea7 479or an octal number.
c0fcf4e1
A
480If the
481.Ar mode
482is symbolic, a starting value of zero is assumed and the
483.Ar mode
484sets or clears permissions without regard to the process' file mode
44bd5ea7 485creation mask.
c0fcf4e1
A
486If the
487.Ar mode
488is octal, only bits 07777
489.Pq Dv S_ISUID | S_ISGID | S_ISTXT | S_IRWXU | S_IRWXG | S_IRWXO
44bd5ea7
A
490of the file's mode bits participate
491in the comparison.
c0fcf4e1
A
492If the
493.Ar mode
494is preceded by a dash
495.Pq Dq Li - ,
496this primary evaluates to true
497if at least all of the bits in the
498.Ar mode
499are set in the file's mode bits.
500If the
501.Ar mode
502is preceded by a plus
503.Pq Dq Li + ,
504this primary evaluates to true
505if any of the bits in the
506.Ar mode
507are set in the file's mode bits.
508Otherwise, this primary evaluates to true if
509the bits in the
510.Ar mode
511exactly match the file's mode bits.
512Note, the first character of a symbolic mode may not be a dash
513.Pq Dq Li - .
44bd5ea7
A
514.It Ic -print
515This primary always evaluates to true.
c0fcf4e1 516It prints the pathname of the current file to standard output.
44bd5ea7 517If none of
c0fcf4e1
A
518.Ic -exec , -ls , -print0 ,
519or
520.Ic -ok
44bd5ea7 521is specified, the given expression shall be effectively replaced by
c0fcf4e1 522.Cm \&( Ar "given expression" Cm \&) Ic -print .
44bd5ea7
A
523.It Ic -print0
524This primary always evaluates to true.
c0fcf4e1
A
525It prints the pathname of the current file to standard output, followed by an
526.Tn ASCII NUL
527character (character code 0).
44bd5ea7
A
528.It Ic -prune
529This primary always evaluates to true.
530It causes
531.Nm
532to not descend into the current file.
533Note, the
534.Ic -prune
535primary has no effect if the
536.Fl d
537option was specified.
c0fcf4e1
A
538.It Ic -regex Ar pattern
539True if the whole path of the file matches
540.Ar pattern
541using regular expression.
542To match a file named
543.Dq Pa ./foo/xyzzy ,
544you can use the regular expression
545.Dq Li ".*/[xyz]*"
546or
547.Dq Li ".*/foo/.*" ,
548but not
549.Dq Li xyzzy
550or
551.Dq Li /foo/ .
552.It Ic -size Ar n Ns Op Cm c
44bd5ea7 553True if the file's size, rounded up, in 512\-byte blocks is
c0fcf4e1 554.Ar n .
44bd5ea7
A
555If
556.Ar n
c0fcf4e1
A
557is followed by a
558.Cm c ,
559then the primary is true if the
44bd5ea7
A
560file's size is
561.Ar n
c0fcf4e1
A
562bytes (characters).
563.It Ic -type Ar t
44bd5ea7
A
564True if the file is of the specified type.
565Possible file types are as follows:
566.Pp
c0fcf4e1 567.Bl -tag -width indent -compact
44bd5ea7
A
568.It Cm b
569block special
570.It Cm c
571character special
572.It Cm d
573directory
574.It Cm f
575regular file
576.It Cm l
577symbolic link
578.It Cm p
579FIFO
580.It Cm s
581socket
582.El
c0fcf4e1 583.It Ic -user Ar uname
44bd5ea7 584True if the file belongs to the user
c0fcf4e1 585.Ar uname .
44bd5ea7
A
586If
587.Ar uname
588is numeric and there is no such user name, then
589.Ar uname
c0fcf4e1 590is treated as a user ID.
44bd5ea7
A
591.El
592.Pp
593All primaries which take a numeric argument allow the number to be
c0fcf4e1
A
594preceded by a plus sign
595.Pq Dq Li +
596or a minus sign
597.Pq Dq Li - .
598A preceding plus sign means
599.Dq more than n ,
600a preceding minus sign means
601.Dq less than n
602and neither means
603.Dq exactly n .
44bd5ea7
A
604.Sh OPERATORS
605The primaries may be combined using the following operators.
606The operators are listed in order of decreasing precedence.
c0fcf4e1
A
607.Pp
608.Bl -tag -width "( expression )" -compact
609.It Cm \&( Ar expression Cm \&)
44bd5ea7
A
610This evaluates to true if the parenthesized expression evaluates to
611true.
612.Pp
9bafe280
A
613.It Cm \&! Ar expression
614.It Cm -false Ar expression
615.It Cm -not Ar expression
44bd5ea7
A
616This is the unary
617.Tn NOT
618operator.
619It evaluates to true if the expression is false.
620.Pp
c0fcf4e1
A
621.It Ar expression Cm -and Ar expression
622.It Ar expression expression
44bd5ea7
A
623The
624.Cm -and
625operator is the logical
626.Tn AND
627operator.
628As it is implied by the juxtaposition of two expressions it does not
629have to be specified.
630The expression evaluates to true if both expressions are true.
631The second expression is not evaluated if the first expression is false.
632.Pp
c0fcf4e1 633.It Ar expression Cm -or Ar expression
44bd5ea7
A
634The
635.Cm -or
636operator is the logical
637.Tn OR
638operator.
639The expression evaluates to true if either the first or the second expression
640is true.
641The second expression is not evaluated if the first expression is true.
642.El
643.Pp
644All operands and primaries must be separate arguments to
c0fcf4e1 645.Nm .
44bd5ea7
A
646Primaries which themselves take arguments expect each argument
647to be a separate argument to
c0fcf4e1 648.Nm .
44bd5ea7 649.Sh EXAMPLES
44bd5ea7 650The following examples are shown as given to the shell:
c0fcf4e1
A
651.Bl -tag -width indent
652.It Li "find / \e! -name \*q*.c\*q -print"
653Print out a list of all the files whose names do not end in
654.Pa .c .
655.It Li "find / -newer ttt -user wnj -print"
656Print out a list of all the files owned by user
657.Dq wnj
658that are newer
659than the file
660.Pa ttt .
661.It Li "find / \e! \e( -newer ttt -user wnj \e) -print"
662Print out a list of all the files which are not both newer than
663.Pa ttt
664and owned by
665.Dq wnj .
666.It Li "find / \e( -newer ttt -or -user wnj \e) -print"
667Print out a list of all the files that are either owned by
668.Dq wnj
669or that are newer than
670.Pa ttt .
671.It Li "find . -newerct '1 minute ago' -print"
672Print out a list of all the files whose inode change time is more
673recent than the current time minus one minute.
44bd5ea7
A
674.El
675.Sh SEE ALSO
c0fcf4e1 676.Xr chflags 1 ,
44bd5ea7 677.Xr chmod 1 ,
c0fcf4e1 678.Xr cvs 1 ,
44bd5ea7 679.Xr locate 1 ,
c0fcf4e1
A
680.Xr whereis 1 ,
681.Xr which 1 ,
44bd5ea7
A
682.Xr stat 2 ,
683.Xr fts 3 ,
44bd5ea7 684.Xr getgrent 3 ,
c0fcf4e1 685.Xr getpwent 3 ,
44bd5ea7 686.Xr strmode 3 ,
c0fcf4e1 687.Xr re_format 7 ,
44bd5ea7
A
688.Xr symlink 7
689.Sh STANDARDS
690The
691.Nm
692utility syntax is a superset of the syntax specified by the
693.St -p1003.2
694standard.
695.Pp
c0fcf4e1
A
696All the single character options as well as the
697.Ic -iname , -inum , -iregex , -print0 , -delete , -ls ,
44bd5ea7 698and
c0fcf4e1 699.Ic -regex
44bd5ea7
A
700primaries are extensions to
701.St -p1003.2 .
702.Pp
703Historically, the
c0fcf4e1 704.Fl d , h
44bd5ea7
A
705and
706.Fl x
c0fcf4e1
A
707options were implemented using the primaries
708.Ic -depth , -follow ,
709and
710.Ic -xdev .
44bd5ea7
A
711These primaries always evaluated to true.
712As they were really global variables that took effect before the traversal
713began, some legal expressions could have unexpected results.
c0fcf4e1
A
714An example is the expression
715.Ic -print Cm -o Ic -depth .
716As
717.Ic -print
718always evaluates to true, the standard order of evaluation
719implies that
720.Ic -depth
721would never be evaluated.
44bd5ea7
A
722This is not the case.
723.Pp
c0fcf4e1
A
724The operator
725.Cm -or
726was implemented as
727.Cm -o ,
728and the operator
729.Cm -and
730was implemented as
731.Cm -a .
44bd5ea7
A
732.Pp
733Historic implementations of the
734.Ic -exec
735and
736.Ic -ok
c0fcf4e1
A
737primaries did not replace the string
738.Dq Li {}
739in the utility name or the
44bd5ea7
A
740utility arguments if it had preceding or following non-whitespace characters.
741This version replaces it no matter where in the utility name or arguments
742it appears.
c0fcf4e1
A
743.Pp
744The
745.Fl E
746option was implemented on the analogy of
747.Xr grep 1
748and
749.Xr sed 1 .
44bd5ea7
A
750.Sh BUGS
751The special characters used by
752.Nm
753are also special characters to many shell programs.
c0fcf4e1
A
754In particular, the characters
755.Dq Li * ,
756.Dq Li \&[ ,
757.Dq Li \&] ,
758.Dq Li \&? ,
759.Dq Li \&( ,
760.Dq Li \&) ,
761.Dq Li \&! ,
762.Dq Li \e
763and
764.Dq Li \&;
765may have to be escaped from the shell.
44bd5ea7
A
766.Pp
767As there is no delimiter separating options and file names or file
768names and the
769.Ar expression ,
c0fcf4e1
A
770it is difficult to specify files named
771.Pa -xdev
772or
773.Pa \&! .
44bd5ea7
A
774These problems are handled by the
775.Fl f
776option and the
777.Xr getopt 3
c0fcf4e1
A
778.Dq Fl Fl
779construct.
780.Pp
781The
782.Ic -delete
783primary does not interact well with other options that cause the filesystem
784tree traversal options to be changed.
785.Sh HISTORY
786A
787.Nm
788command appeared in
789.At v1 .