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