[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.34

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