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

1.48    ! millert     1: .\"    $OpenBSD: find.1,v 1.47 2005/03/14 15:29:15 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.48    ! millert    42: .Op Fl dHhLXx
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.
                     99: .It Fl X
1.16      aaron     100: Permit
1.1       deraadt   101: .Nm
                    102: to be safely used in conjunction with
                    103: .Xr xargs 1 .
                    104: If a file name contains any of the delimiting characters used by
                    105: .Xr xargs ,
                    106: a diagnostic message is displayed on standard error, and the file
                    107: is skipped.
1.22      aaron     108: The delimiting characters include single
                    109: .Pq Ql '
                    110: and double
                    111: .Pq Ql \&"
                    112: quotes, backslash
                    113: .Pq Ql \e ,
                    114: space, tab, and newline
                    115: .Pq Sq \en
                    116: characters.
1.41      millert   117: Alternatively, the
1.4       deraadt   118: .Fl print0
1.41      millert   119: primary may be used in conjunction with the
1.4       deraadt   120: .Fl 0
1.41      millert   121: option to
                    122: .Xr xargs 1 ,
                    123: allowing all file names to be processed safely.
1.1       deraadt   124: .It Fl x
1.16      aaron     125: Prevents
1.22      aaron     126: .Nm
1.1       deraadt   127: from descending into directories that have a device number different
                    128: than that of the file from which the descent began.
                    129: .El
                    130: .Sh PRIMARIES
                    131: .Bl -tag -width Ds
1.22      aaron     132: .It Ic -amin Ar n
1.15      deraadt   133: True if the difference between the file last access time and the time
1.22      aaron     134: .Nm
1.20      aaron     135: was started, rounded up to the next full minute, is
1.15      deraadt   136: .Ar n
1.20      aaron     137: minutes.
1.24      millert   138: .It Ic -anewer Ar file
                    139: True if the current file has a more recent last access time than
1.25      aaron     140: .Ar file .
1.22      aaron     141: .It Ic -atime Ar n
1.1       deraadt   142: True if the difference between the file last access time and the time
1.22      aaron     143: .Nm
                    144: was started, rounded up to the next full 24-hour period, is
1.1       deraadt   145: .Ar n
1.22      aaron     146: 24-hour periods.
                    147: .It Ic -cmin Ar n
1.15      deraadt   148: True if the difference between the time of last change of file status
                    149: information and the time
1.22      aaron     150: .Nm
1.20      aaron     151: was started, rounded up to the next full minute, is
1.15      deraadt   152: .Ar n
1.20      aaron     153: minutes.
1.24      millert   154: .It Ic -cnewer Ar file
                    155: True if the current file has a more recent last change time than
1.25      aaron     156: .Ar file .
1.22      aaron     157: .It Ic -ctime Ar n
1.1       deraadt   158: True if the difference between the time of last change of file status
                    159: information and the time
1.22      aaron     160: .Nm
                    161: was started, rounded up to the next full 24-hour period, is
1.1       deraadt   162: .Ar n
1.22      aaron     163: 24-hour periods.
1.8       tholo     164: .It Ic -empty
                    165: True if the current file or directory is empty.
1.22      aaron     166: .It Ic -exec Ar utility Op argument ... ;
1.1       deraadt   167: True if the program named
                    168: .Ar utility
                    169: returns a zero value as its exit status.
                    170: Optional arguments may be passed to the utility.
1.22      aaron     171: The expression must be terminated by a semicolon
                    172: .Pq Ql \&; .
                    173: If the string
                    174: .Qq {}
                    175: appears anywhere in the utility name or the
1.1       deraadt   176: arguments it is replaced by the pathname of the current file.
1.16      aaron     177: .Ar utility
1.1       deraadt   178: will be executed from the directory from which
1.22      aaron     179: .Nm
1.1       deraadt   180: was executed.
1.22      aaron     181: .It Ic -execdir Ar utility Op argument ... ;
                    182: Identical to the
1.10      millert   183: .Ic -exec
                    184: primary with the exception that
1.16      aaron     185: .Ar utility
1.10      millert   186: will be executed from the directory that holds
1.25      aaron     187: the current file.
                    188: The filename substituted for the string
1.22      aaron     189: .Qq {}
                    190: is not qualified.
1.28      millert   191: .It Xo
                    192: .Ic -flags
                    193: .Op Fl
                    194: .Ar flags
                    195: .Xc
                    196: The
                    197: .Ar flags
                    198: are comma-separated symbolic file flags (see
                    199: .Xr chflags 1
                    200: for a list of valid flag names).
                    201: If the flags are preceded by a dash
                    202: .Pq Sq \- ,
                    203: this primary evaluates to true if the file in question has at least
                    204: one of the file flags specified by
                    205: .Ar flags .
                    206: If the flags are not preceded by a dash, this primary evaluates to true if the
                    207: flags specified exactly match those of the file.
1.2       deraadt   208: .It Ic -follow
                    209: Follow symbolic links.
1.22      aaron     210: .It Ic -fstype Ar type
1.1       deraadt   211: True if the file is contained in a file system of type
                    212: .Ar type .
1.22      aaron     213: Two special file system types are recognized:
                    214: .Dq local
                    215: and
                    216: .Dq rdonly .
1.1       deraadt   217: These do not describe actual file system types;
                    218: the former matches any file system physically mounted on the system where
1.22      aaron     219: .Nm
                    220: is being executed whereas the latter matches any file system which is
1.1       deraadt   221: mounted read-only.
1.22      aaron     222: .It Ic -group Ar gname
1.1       deraadt   223: True if the file belongs to the group
1.25      aaron     224: .Ar gname .
1.1       deraadt   225: If
                    226: .Ar gname
                    227: is numeric and there is no such group name, then
                    228: .Ar gname
1.16      aaron     229: is treated as a group ID.
1.27      deraadt   230: .It Ic -iname Ar pattern
                    231: True if the last component of the pathname being examined
                    232: matches
                    233: .Ar pattern .
                    234: Case insensitive.
1.22      aaron     235: .It Ic -inum Ar n
1.1       deraadt   236: True if the file has inode number
1.25      aaron     237: .Ar n .
1.22      aaron     238: .It Ic -links Ar n
1.1       deraadt   239: True if the file has
                    240: .Ar n
                    241: links.
                    242: .It Ic -ls
                    243: This primary always evaluates to true.
                    244: The following information for the current file is written to standard output:
1.22      aaron     245: its inode number, size in 512-byte blocks, file permissions, number of hard
1.1       deraadt   246: links, owner, group, size in bytes, last modification time, and pathname.
                    247: If the file is a block or character special file, the major and minor numbers
                    248: will be displayed instead of the size in bytes.
1.22      aaron     249: If the file is a symbolic link, the pathname of the linked-to file will be
                    250: displayed preceded by
                    251: .Dq \-> .
                    252: The format is identical to that produced by
                    253: .Dq ls \-dgils .
1.6       tholo     254: .It Ic -maxdepth Ar n
1.7       tholo     255: True if the current search depth is less than or equal to what is specified in
                    256: .Ar n .
                    257: .It Ic -mindepth Ar n
                    258: True if the current search depth is at least what is specified in
1.6       tholo     259: .Ar n .
1.22      aaron     260: .It Ic -mmin Ar n
1.15      deraadt   261: True if the difference between the file last modification time and the time
1.22      aaron     262: .Nm
1.20      aaron     263: was started, rounded up to the next full minute, is
1.15      deraadt   264: .Ar n
1.20      aaron     265: minutes.
1.22      aaron     266: .It Ic -mtime Ar n
1.1       deraadt   267: True if the difference between the file last modification time and the time
1.22      aaron     268: .Nm
                    269: was started, rounded up to the next full 24-hour period, is
1.1       deraadt   270: .Ar n
1.22      aaron     271: 24-hour periods.
                    272: .It Ic -name Ar pattern
1.1       deraadt   273: True if the last component of the pathname being examined matches
1.25      aaron     274: .Ar pattern .
1.22      aaron     275: Special shell pattern matching characters
                    276: .Pf ( Ql [ ,
                    277: .Ql \&] ,
                    278: .Ql * ,
                    279: and
1.40      jmc       280: .Ql \&? )
1.1       deraadt   281: may be used as part of
1.25      aaron     282: .Ar pattern .
1.1       deraadt   283: These characters may be matched explicitly by escaping them with a
1.22      aaron     284: backslash
                    285: .Pq Ql \e .
                    286: .It Ic -newer Ar file
1.1       deraadt   287: True if the current file has a more recent last modification time than
1.25      aaron     288: .Ar file .
1.44      jmc       289: .It Ic -nogroup
                    290: True if the file belongs to an unknown group.
1.1       deraadt   291: .It Ic -nouser
                    292: True if the file belongs to an unknown user.
1.22      aaron     293: .It Ic \&-ok Ar utility Op argument ... ;
                    294: Identical to the
                    295: .Ic -exec
                    296: primary with the exception that
                    297: .Nm
                    298: requests user affirmation for the execution of
                    299: .Ar utility
                    300: by printing
                    301: a message to the terminal and reading a response.
                    302: If the response is other than
                    303: .Sq y
                    304: the command is not executed and the
                    305: value of the
                    306: .Ic \&ok
                    307: expression is false.
                    308: .It Ic -path Ar pattern
1.1       deraadt   309: True if the pathname being examined matches
1.25      aaron     310: .Ar pattern .
1.22      aaron     311: Special shell pattern matching characters
                    312: .Pf ( Ql [ ,
                    313: .Ql \&] ,
                    314: .Ql * ,
                    315: and
1.40      jmc       316: .Ql \&? )
1.1       deraadt   317: may be used as part of
1.25      aaron     318: .Ar pattern .
1.1       deraadt   319: These characters may be matched explicitly by escaping them with a
1.22      aaron     320: backslash
                    321: .Pq Ql \e .
                    322: Slashes
                    323: .Pq Ql /
                    324: are treated as normal characters and do not have to be
1.1       deraadt   325: matched explicitly.
1.21      aaron     326: .It Xo
                    327: .Ic -perm
                    328: .Op Fl
                    329: .Ar mode
                    330: .Xc
1.1       deraadt   331: The
                    332: .Ar mode
                    333: may be either symbolic (see
1.25      aaron     334: .Xr chmod 1 )
1.1       deraadt   335: or an octal number.
                    336: If the mode is symbolic, a starting value of zero is assumed and the
1.16      aaron     337: mode sets or clears permissions without regard to the process's file mode
1.1       deraadt   338: creation mask.
                    339: If the mode is octal, only bits 07777
                    340: .Pf ( Dv S_ISUID
                    341: |
                    342: .Dv S_ISGID
                    343: |
                    344: .Dv S_ISTXT
                    345: |
                    346: .Dv S_IRWXU
                    347: |
                    348: .Dv S_IRWXG
                    349: |
                    350: .Dv S_IRWXO )
                    351: of the file's mode bits participate
                    352: in the comparison.
1.22      aaron     353: If the mode is preceded by a dash
                    354: .Pq Sq \- ,
                    355: this primary evaluates to true
1.1       deraadt   356: if at least all of the bits in the mode are set in the file's mode bits.
1.22      aaron     357: If the mode is not preceded by a dash, this primary evaluates to
1.16      aaron     358: true if the bits in the mode exactly match the file's mode bits.
1.22      aaron     359: Note, the first character of a symbolic mode may not be a dash.
1.1       deraadt   360: .It Ic -print
                    361: This primary always evaluates to true.
                    362: It prints the pathname of the current file to standard output, followed
1.22      aaron     363: by a newline
                    364: .Pq Ql \en
                    365: character.
1.1       deraadt   366: If neither
                    367: .Ic -exec ,
                    368: .Ic -ls ,
                    369: .Ic -ok ,
                    370: nor
                    371: .Ic -print0
                    372: is specified, the given expression shall be effectively replaced by
1.22      aaron     373: .Cm \&( Ns Ar given\& expression Ns Cm \&)
1.1       deraadt   374: .Ic -print .
                    375: .It Ic -print0
                    376: This primary always evaluates to true.
                    377: It prints the pathname of the current file to standard output, followed
                    378: by a null character.
                    379: .It Ic -prune
                    380: This primary always evaluates to true.
                    381: It causes
1.22      aaron     382: .Nm
1.1       deraadt   383: to not descend into the current file.
                    384: Note, the
                    385: .Ic -prune
                    386: primary has no effect if the
                    387: .Fl d
                    388: option was specified.
1.22      aaron     389: .It Ic -size Ar n Ns Op Cm c
                    390: True if the file's size, rounded up, in 512-byte blocks is
1.25      aaron     391: .Ar n .
1.1       deraadt   392: If
                    393: .Ar n
1.22      aaron     394: is followed by a
                    395: .Sq c ,
                    396: then the primary is true if the
1.1       deraadt   397: file's size is
                    398: .Ar n
                    399: bytes.
1.22      aaron     400: .It Ic -type Ar t
1.1       deraadt   401: True if the file is of the specified type.
                    402: Possible file types are as follows:
                    403: .Pp
                    404: .Bl -tag -width flag -offset indent -compact
                    405: .It Cm b
                    406: block special
                    407: .It Cm c
                    408: character special
                    409: .It Cm d
                    410: directory
                    411: .It Cm f
                    412: regular file
                    413: .It Cm l
                    414: symbolic link
                    415: .It Cm p
                    416: FIFO
                    417: .It Cm s
                    418: socket
                    419: .El
                    420: .Pp
1.22      aaron     421: .It Ic -user Ar uname
1.1       deraadt   422: True if the file belongs to the user
1.25      aaron     423: .Ar uname .
1.1       deraadt   424: If
                    425: .Ar uname
                    426: is numeric and there is no such user name, then
                    427: .Ar uname
1.16      aaron     428: is treated as a user ID.
1.1       deraadt   429: .El
                    430: .Pp
                    431: All primaries which take a numeric argument allow the number to be
1.22      aaron     432: preceded by a plus sign
                    433: .Pq Ql +
                    434: or a minus sign
                    435: .Pq Ql \- .
                    436: A preceding plus sign means
                    437: .Dq more than n ,
                    438: a preceding minus sign means
                    439: .Dq less than n ,
                    440: and neither means
                    441: .Dq exactly n .
1.1       deraadt   442: .Sh OPERATORS
                    443: The primaries may be combined using the following operators.
                    444: The operators are listed in order of decreasing precedence.
1.47      jmc       445: .Pp
                    446: .Bl -tag -width "(expression)" -compact
1.22      aaron     447: .It Cm \&( Ns Ar expression Ns Cm \&)
1.1       deraadt   448: This evaluates to true if the parenthesized expression evaluates to
                    449: true.
                    450: .Pp
1.22      aaron     451: .It Cm \&! Ns Ar expression
1.1       deraadt   452: This is the unary
                    453: .Tn NOT
                    454: operator.
                    455: It evaluates to true if the expression is false.
                    456: .Pp
1.22      aaron     457: .It Ar expression Cm -and Ar expression
                    458: .It Ar expression expression
1.1       deraadt   459: The
                    460: .Cm -and
                    461: operator is the logical
                    462: .Tn AND
                    463: operator.
                    464: As it is implied by the juxtaposition of two expressions it does not
                    465: have to be specified.
                    466: The expression evaluates to true if both expressions are true.
                    467: The second expression is not evaluated if the first expression is false.
                    468: .Pp
1.22      aaron     469: .It Ar expression Cm -or Ar expression
1.1       deraadt   470: The
                    471: .Cm -or
                    472: operator is the logical
                    473: .Tn OR
                    474: operator.
                    475: The expression evaluates to true if either the first or the second expression
                    476: is true.
                    477: The second expression is not evaluated if the first expression is true.
                    478: .El
                    479: .Pp
                    480: All operands and primaries must be separate arguments to
1.22      aaron     481: .Nm find .
1.1       deraadt   482: Primaries which themselves take arguments expect each argument
                    483: to be a separate argument to
1.22      aaron     484: .Nm find .
1.1       deraadt   485: .Sh EXAMPLES
1.22      aaron     486: Print out a list of all the files whose names do not end in
1.43      jaredy    487: .Dq \&.c :
                    488: .Pp
                    489: .Dl "$ find / \e! -name '*.c' -print"
                    490: .Pp
1.22      aaron     491: Print out a list of all the files owned by user
                    492: .Dq wnj
1.43      jaredy    493: that are newer than the file
                    494: .Dq ttt :
                    495: .Pp
                    496: .Dl "$ find / -newer ttt -user wnj -print"
                    497: .Pp
1.22      aaron     498: Print out a list of all the files which are not both newer than
                    499: .Dq ttt
                    500: and owned by
1.43      jaredy    501: .Dq wnj :
                    502: .Pp
                    503: .Dl "$ find / \e! \e( -newer ttt -user wnj \e) -print"
                    504: .Pp
1.22      aaron     505: Print out a list of all the files that are either owned by
                    506: .Dq wnj
                    507: or
                    508: that are newer than
1.43      jaredy    509: .Dq ttt :
                    510: .Pp
                    511: .Dl "$ find / \e( -newer ttt -or -user wnj \e) -print"
                    512: .Pp
                    513: Print out a list of all core files on local file systems:
                    514: .Pp
                    515: .Dl "$ find / \e! -fstype local -prune -or -name '*.core' -print"
1.46      jmc       516: .Pp
                    517: Find all files in
                    518: .Pa /usr/src
                    519: ending in a dot and single digit, but skip directory
                    520: .Pa /usr/src/gnu :
                    521: .Pp
                    522: .Dl "$ find /usr/src -path /usr/src/gnu -prune -or -name \e*\e.[0-9]"
1.1       deraadt   523: .Sh SEE ALSO
1.29      millert   524: .Xr chflags 1 ,
1.1       deraadt   525: .Xr chmod 1 ,
                    526: .Xr locate 1 ,
1.23      aaron     527: .Xr whereis 1 ,
                    528: .Xr which 1 ,
1.41      millert   529: .Xr xargs 1 ,
1.1       deraadt   530: .Xr stat 2 ,
                    531: .Xr fts 3 ,
1.16      aaron     532: .Xr getgrent 3 ,
1.1       deraadt   533: .Xr getpwent 3 ,
                    534: .Xr strmode 3 ,
                    535: .Xr symlink 7
                    536: .Sh STANDARDS
                    537: The
1.22      aaron     538: .Nm
1.1       deraadt   539: utility syntax is a superset of the syntax specified by the
                    540: .St -p1003.2
                    541: standard.
                    542: .Pp
1.13      deraadt   543: The options and primaries
1.18      deraadt   544: .Ic -amin ,
                    545: .Ic -cmin ,
1.9       tholo     546: .Ic -empty ,
1.1       deraadt   547: .Ic -follow ,
                    548: .Ic -fstype ,
1.27      deraadt   549: .Ic -iname ,
1.2       deraadt   550: .Ic -inum ,
1.1       deraadt   551: .Ic -links ,
1.9       tholo     552: .Ic -ls ,
1.18      deraadt   553: .Ic -mmin ,
1.9       tholo     554: .Ic -maxdepth ,
1.13      deraadt   555: .Ic -mindepth ,
                    556: .Ic -execdir ,
1.1       deraadt   557: and
                    558: .Ic -print0
1.13      deraadt   559: are extensions to
1.1       deraadt   560: .St -p1003.2 .
1.27      deraadt   561: The
                    562: .Ic -iname
                    563: option was inspired by GNU find.
1.1       deraadt   564: .Pp
                    565: Historically, the
                    566: .Fl d ,
1.26      aaron     567: .Fl H ,
1.1       deraadt   568: and
                    569: .Fl x
1.14      deraadt   570: options were implemented using the primaries
                    571: .Ic -depth ,
                    572: .Ic -follow ,
                    573: and
                    574: .Ic -xdev .
1.1       deraadt   575: These primaries always evaluated to true.
                    576: As they were really global variables that took effect before the traversal
                    577: began, some legal expressions could have unexpected results.
1.22      aaron     578: An example is the expression
                    579: .Dq \-print \-o \-depth .
                    580: As
                    581: .Cm \-print
                    582: always evaluates to true, the standard order of evaluation
                    583: implies that
                    584: .Cm \-depth
                    585: would never be evaluated.
1.1       deraadt   586: This is not the case.
                    587: .Pp
1.22      aaron     588: The operator
                    589: .Cm -or
                    590: was implemented as
                    591: .Cm \-o ,
                    592: and the operator
                    593: .Cm -and
                    594: was implemented as
                    595: .Cm \-a .
1.1       deraadt   596: .Pp
                    597: Historic implementations of the
                    598: .Ic -exec
                    599: and
                    600: .Ic -ok
1.22      aaron     601: primaries did not replace the string
                    602: .Qq {}
                    603: in the utility name or the
1.1       deraadt   604: utility arguments if it had preceding or following non-whitespace characters.
                    605: This version replaces it no matter where in the utility name or arguments
                    606: it appears.
1.30      aaron     607: .Sh HISTORY
                    608: A
                    609: .Nm
                    610: command appeared in
                    611: .At v1 .
1.1       deraadt   612: .Sh BUGS
                    613: The special characters used by
1.22      aaron     614: .Nm
1.1       deraadt   615: are also special characters to many shell programs.
1.22      aaron     616: In particular, the characters
                    617: .Ql * ,
                    618: .Ql [ ,
                    619: .Ql \&] ,
1.40      jmc       620: .Ql \&? ,
1.22      aaron     621: .Ql ( ,
                    622: .Ql \&) ,
1.40      jmc       623: .Ql \&! ,
1.22      aaron     624: .Ql \e ,
                    625: and
                    626: .Ql \&;
                    627: may have to be escaped from the shell.
1.1       deraadt   628: .Pp
                    629: As there is no delimiter separating options and file names or file
                    630: names and the
                    631: .Ar expression ,
1.22      aaron     632: it is difficult to specify files named
                    633: .Dq -xdev
                    634: or
1.40      jmc       635: .Dq \&! .
1.1       deraadt   636: These problems are handled by the
                    637: .Fl f
                    638: option and the
                    639: .Xr getopt 3
1.22      aaron     640: .Dq \-\-
                    641: construct.