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