[BACK]Return to find.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / find

Annotation of src/usr.bin/find/find.1, Revision 1.46

1.46    ! jmc         1: .\"    $OpenBSD: find.1,v 1.45 2005/03/14 15:22:27 jmc Exp $
1.1       deraadt     2: .\" Copyright (c) 1990, 1993
                      3: .\"    The Regents of the University of California.  All rights reserved.
                      4: .\"
                      5: .\" This code is derived from software contributed to Berkeley by
                      6: .\" the Institute of Electrical and Electronics Engineers, Inc.
                      7: .\"
                      8: .\" Redistribution and use in source and binary forms, with or without
                      9: .\" modification, are permitted provided that the following conditions
                     10: .\" are met:
                     11: .\" 1. Redistributions of source code must retain the above copyright
                     12: .\"    notice, this list of conditions and the following disclaimer.
                     13: .\" 2. Redistributions in binary form must reproduce the above copyright
                     14: .\"    notice, this list of conditions and the following disclaimer in the
                     15: .\"    documentation and/or other materials provided with the distribution.
1.38      millert    16: .\" 3. Neither the name of the University nor the names of its contributors
1.1       deraadt    17: .\"    may be used to endorse or promote products derived from this software
                     18: .\"    without specific prior written permission.
                     19: .\"
                     20: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     21: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     22: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     23: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     24: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     25: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     26: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     27: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     28: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     29: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     30: .\" SUCH DAMAGE.
                     31: .\"
                     32: .\"    from: @(#)find.1        8.1 (Berkeley) 6/6/93
                     33: .\"
1.24      millert    34: .Dd December 4, 1999
1.1       deraadt    35: .Dt FIND 1
                     36: .Os
                     37: .Sh NAME
                     38: .Nm find
                     39: .Nd walk a file hierarchy
                     40: .Sh SYNOPSIS
                     41: .Nm find
1.42      jmc        42: .Op Fl dHhLWXx
1.43      jaredy     43: .Op Fl f Ar path
                     44: .Ar path ...\&
1.34      deraadt    45: .Op Ar expression
1.1       deraadt    46: .Sh DESCRIPTION
1.22      aaron      47: .Nm
1.1       deraadt    48: recursively descends the directory tree for each
1.43      jaredy     49: .Ar path
1.1       deraadt    50: listed, evaluating an
                     51: .Ar expression
1.22      aaron      52: (composed of the
                     53: .Dq primaries
                     54: and
1.33      hugh       55: .Dq operands
1.22      aaron      56: listed below) in terms
1.12      millert    57: of each file in the tree.
1.34      deraadt    58: In the absence of an expression,
                     59: .Ic -print
                     60: is assumed.
1.1       deraadt    61: .Pp
                     62: The options are as follows:
                     63: .Bl -tag -width Ds
                     64: .It Fl d
1.16      aaron      65: Causes
1.22      aaron      66: .Nm
1.45      jmc        67: to visit directories in post-order
                     68: i.e. all entries in a directory will be acted on before the directory itself.
1.1       deraadt    69: By default,
1.22      aaron      70: .Nm
1.45      jmc        71: visits directories in pre-order i.e. before their contents.
1.43      jaredy     72: .It Fl f Ar path
1.16      aaron      73: Specifies a file hierarchy for
1.22      aaron      74: .Nm
1.1       deraadt    75: to traverse.
                     76: File hierarchies may also be specified as the operands immediately
                     77: following the options.
1.35      millert    78: .It Fl H
                     79: Causes the file information and file type (see
                     80: .Xr stat 2 )
                     81: returned for each symbolic link encountered on the command line to be
                     82: those of the file referenced by the link, not the link itself.
                     83: If the referenced file does not exist, the file information and type will
                     84: be for the link itself.
                     85: File information of all symbolic links not on
                     86: the command line is that of the link itself.
1.1       deraadt    87: .It Fl h
1.35      millert    88: An alias for the
                     89: .Fl L
                     90: option.
1.37      david      91: This option exists for backwards compatibility.
1.35      millert    92: .It Fl L
1.16      aaron      93: Causes the file information and file type (see
1.22      aaron      94: .Xr stat 2 )
1.1       deraadt    95: returned for each symbolic link to be those of the file referenced by the
                     96: link, not the link itself.
                     97: If the referenced file does not exist, the file information and type will
                     98: be for the link itself.
1.42      jmc        99: .It Fl W
                    100: Let
                    101: .Nm
                    102: take whiteouts into account when scanning directories.
1.1       deraadt   103: .It Fl X
1.16      aaron     104: Permit
1.1       deraadt   105: .Nm
                    106: to be safely used in conjunction with
                    107: .Xr xargs 1 .
                    108: If a file name contains any of the delimiting characters used by
                    109: .Xr xargs ,
                    110: a diagnostic message is displayed on standard error, and the file
                    111: is skipped.
1.22      aaron     112: The delimiting characters include single
                    113: .Pq Ql '
                    114: and double
                    115: .Pq Ql \&"
                    116: quotes, backslash
                    117: .Pq Ql \e ,
                    118: space, tab, and newline
                    119: .Pq Sq \en
                    120: characters.
1.41      millert   121: Alternatively, the
1.4       deraadt   122: .Fl print0
1.41      millert   123: primary may be used in conjunction with the
1.4       deraadt   124: .Fl 0
1.41      millert   125: option to
                    126: .Xr xargs 1 ,
                    127: allowing all file names to be processed safely.
1.1       deraadt   128: .It Fl x
1.16      aaron     129: Prevents
1.22      aaron     130: .Nm
1.1       deraadt   131: from descending into directories that have a device number different
                    132: than that of the file from which the descent began.
                    133: .El
                    134: .Sh PRIMARIES
                    135: .Bl -tag -width Ds
1.22      aaron     136: .It Ic -amin Ar n
1.15      deraadt   137: True if the difference between the file last access time and the time
1.22      aaron     138: .Nm
1.20      aaron     139: was started, rounded up to the next full minute, is
1.15      deraadt   140: .Ar n
1.20      aaron     141: minutes.
1.24      millert   142: .It Ic -anewer Ar file
                    143: True if the current file has a more recent last access time than
1.25      aaron     144: .Ar file .
1.22      aaron     145: .It Ic -atime Ar n
1.1       deraadt   146: True if the difference between the file last access time and the time
1.22      aaron     147: .Nm
                    148: was started, rounded up to the next full 24-hour period, is
1.1       deraadt   149: .Ar n
1.22      aaron     150: 24-hour periods.
                    151: .It Ic -cmin Ar n
1.15      deraadt   152: True if the difference between the time of last change of file status
                    153: information and the time
1.22      aaron     154: .Nm
1.20      aaron     155: was started, rounded up to the next full minute, is
1.15      deraadt   156: .Ar n
1.20      aaron     157: minutes.
1.24      millert   158: .It Ic -cnewer Ar file
                    159: True if the current file has a more recent last change time than
1.25      aaron     160: .Ar file .
1.22      aaron     161: .It Ic -ctime Ar n
1.1       deraadt   162: True if the difference between the time of last change of file status
                    163: information and the time
1.22      aaron     164: .Nm
                    165: was started, rounded up to the next full 24-hour period, is
1.1       deraadt   166: .Ar n
1.22      aaron     167: 24-hour periods.
1.8       tholo     168: .It Ic -empty
                    169: True if the current file or directory is empty.
1.22      aaron     170: .It Ic -exec Ar utility Op argument ... ;
1.1       deraadt   171: True if the program named
                    172: .Ar utility
                    173: returns a zero value as its exit status.
                    174: Optional arguments may be passed to the utility.
1.22      aaron     175: The expression must be terminated by a semicolon
                    176: .Pq Ql \&; .
                    177: If the string
                    178: .Qq {}
                    179: appears anywhere in the utility name or the
1.1       deraadt   180: arguments it is replaced by the pathname of the current file.
1.16      aaron     181: .Ar utility
1.1       deraadt   182: will be executed from the directory from which
1.22      aaron     183: .Nm
1.1       deraadt   184: was executed.
1.22      aaron     185: .It Ic -execdir Ar utility Op argument ... ;
                    186: Identical to the
1.10      millert   187: .Ic -exec
                    188: primary with the exception that
1.16      aaron     189: .Ar utility
1.10      millert   190: will be executed from the directory that holds
1.25      aaron     191: the current file.
                    192: The filename substituted for the string
1.22      aaron     193: .Qq {}
                    194: is not qualified.
1.28      millert   195: .It Xo
                    196: .Ic -flags
                    197: .Op Fl
                    198: .Ar flags
                    199: .Xc
                    200: The
                    201: .Ar flags
                    202: are comma-separated symbolic file flags (see
                    203: .Xr chflags 1
                    204: for a list of valid flag names).
                    205: If the flags are preceded by a dash
                    206: .Pq Sq \- ,
                    207: this primary evaluates to true if the file in question has at least
                    208: one of the file flags specified by
                    209: .Ar flags .
                    210: If the flags are not preceded by a dash, this primary evaluates to true if the
                    211: flags specified exactly match those of the file.
1.2       deraadt   212: .It Ic -follow
                    213: Follow symbolic links.
1.22      aaron     214: .It Ic -fstype Ar type
1.1       deraadt   215: True if the file is contained in a file system of type
                    216: .Ar type .
1.22      aaron     217: Two special file system types are recognized:
                    218: .Dq local
                    219: and
                    220: .Dq rdonly .
1.1       deraadt   221: These do not describe actual file system types;
                    222: the former matches any file system physically mounted on the system where
1.22      aaron     223: .Nm
                    224: is being executed whereas the latter matches any file system which is
1.1       deraadt   225: mounted read-only.
1.22      aaron     226: .It Ic -group Ar gname
1.1       deraadt   227: True if the file belongs to the group
1.25      aaron     228: .Ar gname .
1.1       deraadt   229: If
                    230: .Ar gname
                    231: is numeric and there is no such group name, then
                    232: .Ar gname
1.16      aaron     233: is treated as a group ID.
1.27      deraadt   234: .It Ic -iname Ar pattern
                    235: True if the last component of the pathname being examined
                    236: matches
                    237: .Ar pattern .
                    238: Case insensitive.
1.22      aaron     239: .It Ic -inum Ar n
1.1       deraadt   240: True if the file has inode number
1.25      aaron     241: .Ar n .
1.22      aaron     242: .It Ic -links Ar n
1.1       deraadt   243: True if the file has
                    244: .Ar n
                    245: links.
                    246: .It Ic -ls
                    247: This primary always evaluates to true.
                    248: The following information for the current file is written to standard output:
1.22      aaron     249: its inode number, size in 512-byte blocks, file permissions, number of hard
1.1       deraadt   250: links, owner, group, size in bytes, last modification time, and pathname.
                    251: If the file is a block or character special file, the major and minor numbers
                    252: will be displayed instead of the size in bytes.
1.22      aaron     253: If the file is a symbolic link, the pathname of the linked-to file will be
                    254: displayed preceded by
                    255: .Dq \-> .
                    256: The format is identical to that produced by
                    257: .Dq ls \-dgils .
1.6       tholo     258: .It Ic -maxdepth Ar n
1.7       tholo     259: True if the current search depth is less than or equal to what is specified in
                    260: .Ar n .
                    261: .It Ic -mindepth Ar n
                    262: True if the current search depth is at least what is specified in
1.6       tholo     263: .Ar n .
1.22      aaron     264: .It Ic -mmin Ar n
1.15      deraadt   265: True if the difference between the file last modification time and the time
1.22      aaron     266: .Nm
1.20      aaron     267: was started, rounded up to the next full minute, is
1.15      deraadt   268: .Ar n
1.20      aaron     269: minutes.
1.22      aaron     270: .It Ic -mtime Ar n
1.1       deraadt   271: True if the difference between the file last modification time and the time
1.22      aaron     272: .Nm
                    273: was started, rounded up to the next full 24-hour period, is
1.1       deraadt   274: .Ar n
1.22      aaron     275: 24-hour periods.
                    276: .It Ic -name Ar pattern
1.1       deraadt   277: True if the last component of the pathname being examined matches
1.25      aaron     278: .Ar pattern .
1.22      aaron     279: Special shell pattern matching characters
                    280: .Pf ( Ql [ ,
                    281: .Ql \&] ,
                    282: .Ql * ,
                    283: and
1.40      jmc       284: .Ql \&? )
1.1       deraadt   285: may be used as part of
1.25      aaron     286: .Ar pattern .
1.1       deraadt   287: These characters may be matched explicitly by escaping them with a
1.22      aaron     288: backslash
                    289: .Pq Ql \e .
                    290: .It Ic -newer Ar file
1.1       deraadt   291: True if the current file has a more recent last modification time than
1.25      aaron     292: .Ar file .
1.44      jmc       293: .It Ic -nogroup
                    294: True if the file belongs to an unknown group.
1.1       deraadt   295: .It Ic -nouser
                    296: True if the file belongs to an unknown user.
1.22      aaron     297: .It Ic \&-ok Ar utility Op argument ... ;
                    298: Identical to the
                    299: .Ic -exec
                    300: primary with the exception that
                    301: .Nm
                    302: requests user affirmation for the execution of
                    303: .Ar utility
                    304: by printing
                    305: a message to the terminal and reading a response.
                    306: If the response is other than
                    307: .Sq y
                    308: the command is not executed and the
                    309: value of the
                    310: .Ic \&ok
                    311: expression is false.
                    312: .It Ic -path Ar pattern
1.1       deraadt   313: True if the pathname being examined matches
1.25      aaron     314: .Ar pattern .
1.22      aaron     315: Special shell pattern matching characters
                    316: .Pf ( Ql [ ,
                    317: .Ql \&] ,
                    318: .Ql * ,
                    319: and
1.40      jmc       320: .Ql \&? )
1.1       deraadt   321: may be used as part of
1.25      aaron     322: .Ar pattern .
1.1       deraadt   323: These characters may be matched explicitly by escaping them with a
1.22      aaron     324: backslash
                    325: .Pq Ql \e .
                    326: Slashes
                    327: .Pq Ql /
                    328: are treated as normal characters and do not have to be
1.1       deraadt   329: matched explicitly.
1.21      aaron     330: .It Xo
                    331: .Ic -perm
                    332: .Op Fl
                    333: .Ar mode
                    334: .Xc
1.1       deraadt   335: The
                    336: .Ar mode
                    337: may be either symbolic (see
1.25      aaron     338: .Xr chmod 1 )
1.1       deraadt   339: or an octal number.
                    340: If the mode is symbolic, a starting value of zero is assumed and the
1.16      aaron     341: mode sets or clears permissions without regard to the process's file mode
1.1       deraadt   342: creation mask.
                    343: If the mode is octal, only bits 07777
                    344: .Pf ( Dv S_ISUID
                    345: |
                    346: .Dv S_ISGID
                    347: |
                    348: .Dv S_ISTXT
                    349: |
                    350: .Dv S_IRWXU
                    351: |
                    352: .Dv S_IRWXG
                    353: |
                    354: .Dv S_IRWXO )
                    355: of the file's mode bits participate
                    356: in the comparison.
1.22      aaron     357: If the mode is preceded by a dash
                    358: .Pq Sq \- ,
                    359: this primary evaluates to true
1.1       deraadt   360: if at least all of the bits in the mode are set in the file's mode bits.
1.22      aaron     361: If the mode is not preceded by a dash, this primary evaluates to
1.16      aaron     362: true if the bits in the mode exactly match the file's mode bits.
1.22      aaron     363: Note, the first character of a symbolic mode may not be a dash.
1.1       deraadt   364: .It Ic -print
                    365: This primary always evaluates to true.
                    366: It prints the pathname of the current file to standard output, followed
1.22      aaron     367: by a newline
                    368: .Pq Ql \en
                    369: character.
1.1       deraadt   370: If neither
                    371: .Ic -exec ,
                    372: .Ic -ls ,
                    373: .Ic -ok ,
                    374: nor
                    375: .Ic -print0
                    376: is specified, the given expression shall be effectively replaced by
1.22      aaron     377: .Cm \&( Ns Ar given\& expression Ns Cm \&)
1.1       deraadt   378: .Ic -print .
                    379: .It Ic -print0
                    380: This primary always evaluates to true.
                    381: It prints the pathname of the current file to standard output, followed
                    382: by a null character.
                    383: .It Ic -prune
                    384: This primary always evaluates to true.
                    385: It causes
1.22      aaron     386: .Nm
1.1       deraadt   387: to not descend into the current file.
                    388: Note, the
                    389: .Ic -prune
                    390: primary has no effect if the
                    391: .Fl d
                    392: option was specified.
1.22      aaron     393: .It Ic -size Ar n Ns Op Cm c
                    394: True if the file's size, rounded up, in 512-byte blocks is
1.25      aaron     395: .Ar n .
1.1       deraadt   396: If
                    397: .Ar n
1.22      aaron     398: is followed by a
                    399: .Sq c ,
                    400: then the primary is true if the
1.1       deraadt   401: file's size is
                    402: .Ar n
                    403: bytes.
1.22      aaron     404: .It Ic -type Ar t
1.1       deraadt   405: True if the file is of the specified type.
                    406: Possible file types are as follows:
                    407: .Pp
                    408: .Bl -tag -width flag -offset indent -compact
1.3       deraadt   409: .It Cm W
1.22      aaron     410: whiteout (currently, these won't even be visible without also specifying
1.19      espie     411: .Fl W )
1.1       deraadt   412: .It Cm b
                    413: block special
                    414: .It Cm c
                    415: character special
                    416: .It Cm d
                    417: directory
                    418: .It Cm f
                    419: regular file
                    420: .It Cm l
                    421: symbolic link
                    422: .It Cm p
                    423: FIFO
                    424: .It Cm s
                    425: socket
                    426: .El
                    427: .Pp
1.22      aaron     428: .It Ic -user Ar uname
1.1       deraadt   429: True if the file belongs to the user
1.25      aaron     430: .Ar uname .
1.1       deraadt   431: If
                    432: .Ar uname
                    433: is numeric and there is no such user name, then
                    434: .Ar uname
1.16      aaron     435: is treated as a user ID.
1.1       deraadt   436: .El
                    437: .Pp
                    438: All primaries which take a numeric argument allow the number to be
1.22      aaron     439: preceded by a plus sign
                    440: .Pq Ql +
                    441: or a minus sign
                    442: .Pq Ql \- .
                    443: A preceding plus sign means
                    444: .Dq more than n ,
                    445: a preceding minus sign means
                    446: .Dq less than n ,
                    447: and neither means
                    448: .Dq exactly n .
1.1       deraadt   449: .Sh OPERATORS
                    450: The primaries may be combined using the following operators.
                    451: The operators are listed in order of decreasing precedence.
1.22      aaron     452: .Bl -tag -width (expression)
                    453: .It Cm \&( Ns Ar expression Ns Cm \&)
1.1       deraadt   454: This evaluates to true if the parenthesized expression evaluates to
                    455: true.
                    456: .Pp
1.22      aaron     457: .It Cm \&! Ns Ar expression
1.1       deraadt   458: This is the unary
                    459: .Tn NOT
                    460: operator.
                    461: It evaluates to true if the expression is false.
                    462: .Pp
1.22      aaron     463: .It Ar expression Cm -and Ar expression
                    464: .It Ar expression expression
1.1       deraadt   465: The
                    466: .Cm -and
                    467: operator is the logical
                    468: .Tn AND
                    469: operator.
                    470: As it is implied by the juxtaposition of two expressions it does not
                    471: have to be specified.
                    472: The expression evaluates to true if both expressions are true.
                    473: The second expression is not evaluated if the first expression is false.
                    474: .Pp
1.22      aaron     475: .It Ar expression Cm -or Ar expression
1.1       deraadt   476: The
                    477: .Cm -or
                    478: operator is the logical
                    479: .Tn OR
                    480: operator.
                    481: The expression evaluates to true if either the first or the second expression
                    482: is true.
                    483: The second expression is not evaluated if the first expression is true.
                    484: .El
                    485: .Pp
                    486: All operands and primaries must be separate arguments to
1.22      aaron     487: .Nm find .
1.1       deraadt   488: Primaries which themselves take arguments expect each argument
                    489: to be a separate argument to
1.22      aaron     490: .Nm find .
1.1       deraadt   491: .Sh EXAMPLES
1.22      aaron     492: Print out a list of all the files whose names do not end in
1.43      jaredy    493: .Dq \&.c :
                    494: .Pp
                    495: .Dl "$ find / \e! -name '*.c' -print"
                    496: .Pp
1.22      aaron     497: Print out a list of all the files owned by user
                    498: .Dq wnj
1.43      jaredy    499: that are newer than the file
                    500: .Dq ttt :
                    501: .Pp
                    502: .Dl "$ find / -newer ttt -user wnj -print"
                    503: .Pp
1.22      aaron     504: Print out a list of all the files which are not both newer than
                    505: .Dq ttt
                    506: and owned by
1.43      jaredy    507: .Dq wnj :
                    508: .Pp
                    509: .Dl "$ find / \e! \e( -newer ttt -user wnj \e) -print"
                    510: .Pp
1.22      aaron     511: Print out a list of all the files that are either owned by
                    512: .Dq wnj
                    513: or
                    514: that are newer than
1.43      jaredy    515: .Dq ttt :
                    516: .Pp
                    517: .Dl "$ find / \e( -newer ttt -or -user wnj \e) -print"
                    518: .Pp
                    519: Print out a list of all core files on local file systems:
                    520: .Pp
                    521: .Dl "$ find / \e! -fstype local -prune -or -name '*.core' -print"
1.46    ! jmc       522: .Pp
        !           523: Find all files in
        !           524: .Pa /usr/src
        !           525: ending in a dot and single digit, but skip directory
        !           526: .Pa /usr/src/gnu :
        !           527: .Pp
        !           528: .Dl "$ find /usr/src -path /usr/src/gnu -prune -or -name \e*\e.[0-9]"
1.1       deraadt   529: .Sh SEE ALSO
1.29      millert   530: .Xr chflags 1 ,
1.1       deraadt   531: .Xr chmod 1 ,
                    532: .Xr locate 1 ,
1.23      aaron     533: .Xr whereis 1 ,
                    534: .Xr which 1 ,
1.41      millert   535: .Xr xargs 1 ,
1.1       deraadt   536: .Xr stat 2 ,
                    537: .Xr fts 3 ,
1.16      aaron     538: .Xr getgrent 3 ,
1.1       deraadt   539: .Xr getpwent 3 ,
                    540: .Xr strmode 3 ,
                    541: .Xr symlink 7
                    542: .Sh STANDARDS
                    543: The
1.22      aaron     544: .Nm
1.1       deraadt   545: utility syntax is a superset of the syntax specified by the
                    546: .St -p1003.2
                    547: standard.
                    548: .Pp
1.13      deraadt   549: The options and primaries
1.18      deraadt   550: .Ic -amin ,
                    551: .Ic -cmin ,
1.9       tholo     552: .Ic -empty ,
1.1       deraadt   553: .Ic -follow ,
                    554: .Ic -fstype ,
1.27      deraadt   555: .Ic -iname ,
1.2       deraadt   556: .Ic -inum ,
1.1       deraadt   557: .Ic -links ,
1.9       tholo     558: .Ic -ls ,
1.18      deraadt   559: .Ic -mmin ,
1.9       tholo     560: .Ic -maxdepth ,
1.13      deraadt   561: .Ic -mindepth ,
                    562: .Ic -execdir ,
1.1       deraadt   563: and
                    564: .Ic -print0
1.13      deraadt   565: are extensions to
1.1       deraadt   566: .St -p1003.2 .
1.27      deraadt   567: The
                    568: .Ic -iname
                    569: option was inspired by GNU find.
1.1       deraadt   570: .Pp
                    571: Historically, the
                    572: .Fl d ,
1.26      aaron     573: .Fl H ,
1.1       deraadt   574: and
                    575: .Fl x
1.14      deraadt   576: options were implemented using the primaries
                    577: .Ic -depth ,
                    578: .Ic -follow ,
                    579: and
                    580: .Ic -xdev .
1.1       deraadt   581: These primaries always evaluated to true.
                    582: As they were really global variables that took effect before the traversal
                    583: began, some legal expressions could have unexpected results.
1.22      aaron     584: An example is the expression
                    585: .Dq \-print \-o \-depth .
                    586: As
                    587: .Cm \-print
                    588: always evaluates to true, the standard order of evaluation
                    589: implies that
                    590: .Cm \-depth
                    591: would never be evaluated.
1.1       deraadt   592: This is not the case.
                    593: .Pp
1.22      aaron     594: The operator
                    595: .Cm -or
                    596: was implemented as
                    597: .Cm \-o ,
                    598: and the operator
                    599: .Cm -and
                    600: was implemented as
                    601: .Cm \-a .
1.1       deraadt   602: .Pp
                    603: Historic implementations of the
                    604: .Ic -exec
                    605: and
                    606: .Ic -ok
1.22      aaron     607: primaries did not replace the string
                    608: .Qq {}
                    609: in the utility name or the
1.1       deraadt   610: utility arguments if it had preceding or following non-whitespace characters.
                    611: This version replaces it no matter where in the utility name or arguments
                    612: it appears.
1.30      aaron     613: .Sh HISTORY
                    614: A
                    615: .Nm
                    616: command appeared in
                    617: .At v1 .
1.1       deraadt   618: .Sh BUGS
                    619: The special characters used by
1.22      aaron     620: .Nm
1.1       deraadt   621: are also special characters to many shell programs.
1.22      aaron     622: In particular, the characters
                    623: .Ql * ,
                    624: .Ql [ ,
                    625: .Ql \&] ,
1.40      jmc       626: .Ql \&? ,
1.22      aaron     627: .Ql ( ,
                    628: .Ql \&) ,
1.40      jmc       629: .Ql \&! ,
1.22      aaron     630: .Ql \e ,
                    631: and
                    632: .Ql \&;
                    633: may have to be escaped from the shell.
1.1       deraadt   634: .Pp
                    635: As there is no delimiter separating options and file names or file
                    636: names and the
                    637: .Ar expression ,
1.22      aaron     638: it is difficult to specify files named
                    639: .Dq -xdev
                    640: or
1.40      jmc       641: .Dq \&! .
1.1       deraadt   642: These problems are handled by the
                    643: .Fl f
                    644: option and the
                    645: .Xr getopt 3
1.22      aaron     646: .Dq \-\-
                    647: construct.
1.19      espie     648: .Pp
                    649: The
                    650: .Fl W
1.26      aaron     651: option is probably not the most elegant way to handle whiteouts.
                    652: It may be replaced by a more sophisticated algorithm eventually.