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