The find(1) utility recursively descends the directory
tree for each file listed, evaluating an expression
(composed of the primaries and operands listed below) in terms of
each file in the tree.
Performs a depth-first traversal; that is, directories
are visited in post-order, and all entries in a directory are acted
upon before the directory itself. By default, find(1) visits
directories in pre-order; that is, before their contents. Note: the
default is not a breadth-first traversal.
-D
Always display domain name in long formats. The default is to
display the domain name only if it is different from the value of
the environment variable USERDOMAIN, normally the current
domain.
-f
Specifies the file hierarchy for find(1) to traverse.
File hierarchies can also be specified as the operands immediately
following the options.
-h
Causes find(1) to return information about files
referenced by symbolic links rather than about the links
themselves. If the referenced file does not exist, the information
is for the link, not the file.
-H
Follows symbolic links in tree traversal.
-i
Ignores case in file names for the -name and
-path directives. This is useful when dealing with some
networked files systems with Windows.
-L
Same as -h.
-P
Causes find(1) to return information about files
referenced by symbolic links rather than about the links
themselves. If the referenced file does not exist, the information
is for the link, not the file. File information of all symbolic
links not on the command line pertains to the link itself.
-x
Prevents find(1) from descending into directories that
have a device number that differs from that of the file from which
the descent began.
-X
Warns of file names containing delimiting characters used by
xargs(1). If a file name contains any of the delimiting
characters used by xargs(1), find(1) displays a
diagnostic message on standard error and skips the file. Delimiting
characters include single quotes ( ' ), double quotes (
" ), backslash (\), space, tab and newline
characters.
True if the difference between the file last access time and
the time find(1) was started, rounded up to the next full
24-hour period, is n 24-hour periods.
-ctimen
True if the difference between the time of last change of file
status information and the time find(1) was started, rounded
up to the next full 24-hour period, is n 24-hour
periods.
-depth
Same as the -d option.
-empty
True if the current file or directory is empty.
-executility argument ...;
True if the program named utility returns a zero value
as its exit status. Optional arguments can be passed to the
utility. The expression must be terminated by a semicolon (;). If
the string {} appears anywhere in the utility name or the
arguments, it is replaced by the path name of the current file.
Because the semicolon (;) has special meaning to the shell,
it must be escaped or quoted. Utility will be executed from
the directory from which find(1) was executed.
-execdirutility argument ... ;
Identical to -exec, except that the utility is
executed from the directory that holds the current file. The file
name substituted for "{}" is not qualified.
-follow
Same as the -H option.
-fstypetype
True if the file is contained in a file system of type
type. Currently supported types are local,
mfs, nfs, msdos, rdonly, and
ufs. The types local and rdonly are not
specific file-system types. The former matches any file system
physically mounted on the system where the find(1) is being
executed, and the latter matches any file system that is mounted
read-only.
-groupgname
True if the file belongs to the group gname. If
gname is numeric and there is no such group name,
gname is treated as a group id.
-icase
Always true; causes case-insensitive matching for -name
and -path, similar to the -i option.
-inumn
True if the file has file serial number n.
-linksn
True if the file has n links.
-ls
This primary always evaluates to true. The following
information for the current file is written to standard output: its
file serial number, size in 512-byte blocks, file permissions,
number of hard links, owner, group, size in bytes, last
modification time, and path name. If the file is a block or
character special file, the major and minor numbers will be
displayed instead of the size in bytes. If the file is a symbolic
link, the path name of the linked-to file will be displayed
preceded by ->. The format is identical to that produced
by ls -dgils.
-maxdepthn
True if the search depth is at least the value specified in
n. The search will go only that deep, relative to the
starting directory.
-mount
Prevents find(1) from descending into directories whose
device number differs from that of the file from which the descent
began. See the -x option.
-mtimen
True if the difference between the file last modification time
and the time find(1) was started, rounded up to the next
full 24-hour period, is n 24-hour periods.
-okutility argument ... ;
The -ok primary is identical to the -exec primary
with the exception that find(1) requests user affirmation
for the execution of the utility by printing a message to the
terminal and reading a response. If the response is other than
y the command is not executed and the value of the ok
expression is false.
-namepattern
True if the last component of the path name being examined
matches pattern. Special shell-pattern matching characters
([, ], *, and ?) can be used as part of
pattern. These characters can be matched explicitly by
escaping them with a backslash (\). The pattern
should be quoted or escaped to prevent the shell from evaluating
it; see the section entitled Examples.
-newerfile
True if the current file has a more recent last modification
time than file.
-nouser
True if the file belongs to an unknown user.
-nogroup
True if the file belongs to an unknown group.
-pathpattern
True if the path name being examined matches pattern.
Special shell-pattern matching characters ([, ], *, and
?) can be used as part of pattern. These characters
can be matched explicitly by escaping them with a backslash
(\). Forward slashes (/) are treated as normal
characters and need not be matched explicitly.
-permmode
The mode may be either symbolic (see chmod(1)) or
an octal number. If the mode is symbolic, a starting value of zero
is assumed and the mode sets or clears permissions without regard
to the file mode creation mask of the process. If the mode is
octal, only bits 07777 (S_ISUID | S_ISGID | S_IRWXU | S_IRWXG |
S_IRWXO) of the file's mode bits participate in the comparison. If
the mode is preceded by a dash (-), this primary evaluates
to true if at least all of the bits in the mode are set in the
file's mode bits. If the mode is not preceded by a dash, this
primary evaluates to true if the bits in the mode exactly match the
file's mode bits. Note that the first character of a symbolic mode
cannot be a dash (-).
-print
This primary always evaluates to true. It prints the path name
of the current file to standard output. The expression is appended
to the user specified expression if neither -exec,
-ls or -ok is specified.
-print0
This primary always evaluates to true. It prints the path name
of the current file to standard output, followed by a null
character.
-prune
This primary always evaluates to true. It causes find(1)
not to descend into the current file. The -prune primary has
no effect if the -d option was specified.
-sizen[c]
True if the file's size, rounded up, in 512-byte blocks is
n. If n is followed by a c, then the primary is true
if the file's size is n bytes.
-typet
True if the file is of the specified type. Possible file types
are as follows:
b
Block special
c
Character special
d
Directory
f
Regular file
l
Symlink
p
FIFO
s
Socket
-useruname
True if the file belongs to the user uname. If
uname is numeric and there is no such user name,
uname is treated as a user id.
-xdev
Same as -mount.
All primaries that take a numeric argument allow the number to
be preceded by a plus sign (+) or a minus sign (-). A
preceding plus sign means more than n, a preceding minus
sign means less than n, and if neither is present, it means
exactly n.
The primaries may be combined using the following operators. The
operators are listed in order of decreasing precedence.
-levelnum
Only descend num levels in the directory hierachy.
!expression
This is the unary NOT operator. It evaluates to true if
the expression is false. Because the exclamation mark (!)
might have special meaning to your shell, you may need to escape or
quote it in some manner.
(expression)
This evaluates to true if the parenthesized expression
evaluates to true. Because parentheses have special meaning to the
shell, they must be escaped or quoted in some manner.
expression-andexpression
The -and operator is the logical AND operator.
Because it is implied by the juxtaposition of two expressions, it
need not be specified. The expression evaluates to true if both
expressions are true. The second expression is not evaluated if the
first expression is false. It can be shortened to -a.
expression-orexpression
The -or operator is the logical OR operator. The
expression evaluates to true if either the first or the second
expression is true. The second expression is not evaluated if the
first expression is true. The operator can be shortened to
-o.
All operands and primaries must be separate arguments to
find(1). Primaries which themselves take arguments expect
each argument to be a separate argument to find(1).