find.1 (2010 09)
f
find(1) find(1)
-print
Causes the current path name to be printed followed by a newline character. Always true.
-print0
Causes the current path name to be printed followed by a null character. Always true.
-perm [-]mode
In this primary, the argument mode is used to represent file mode bits. The argument is identi-
cal in format to the mode operand as described in chmod (1), with the exception that the first
character must not be the
- operator. When using the symbolic form of mode, the starting tem-
plate is assumed to have all file mode bits cleared.
If the leading minus is omitted, this primary is true when the file permission bits exactly match
the value of mode. Bits associated with the symbolic attributes
s (set-user-ID, set-group-ID) and
t (sticky bit) are ignored when the minus is omitted.
If mode is preceded by a minus, this primary is true if all of the bits that are set in mode are also
set in the file permission bits. In this case, the bits associated with the symbolic attributes
s and
t are significant.
-prune
If the current entry is a directory, cause
find to skip that directory. This can be useful to avoid
walking certain directories, or to avoid recursive loops when using
cpio -p. Note, however,
that -prune is useless if the -depth option has also been given. See the description of
-only
and the EXAMPLES section, below, for more information. Always true.
-size n[c]
True if the file is n blocks long (512 bytes per block). If n is followed by a
c, the size is in bytes.
-type c
True if the type of the file is c, where c is one of the following:
b Block special file
c Character special file
d Directory
f Regular file
l Symbolic link
M Mount point
n Network special file
p FIFO (named pipe)
s Socket
-user uname
True if the file belongs to the user uname .Ifuname is numeric and does not appear as a login
name in the
/etc/passwd file, it is taken as a user ID. The uname operand can be preceded
by a + or - to modify the comparison of the primaries. If the argument n represents a decimal
integer; +n means more than n, -n means less than n, and n means exactly n.
-xdev A position-independent term that causes find to avoid crossing any file system mount points
that exist below starting points enumerated in pathname_list. The mount point itself is visited,
but entries below the mount point are not. Always true.
( expression )
True if the parenthesized expression is true. The spaces are required. Parentheses are special to
the shell and must be escaped, as in \( and \).
Primaries can be combined by using the following operators (in order of decreasing precedence):
expression
[-a] expression
Logical AND operator. True if both of the expression s are true.
expression
-o expression
Logical OR operator. True if either or both of the expression s are true.
! expression Logical NOT operator. True if expression is not true.
If expression is omitted, or if none of
-print, -print0, -ok, -exec, -cpio,or-ncpio is specified,
-print is assumed. The -user, -group, and -newer primaries each evaluate their respective argu-
ments once.
4 Hewlett-Packard Company − 4 − HP-UX 11i Version 3: September 2010