HP-UX Reference (11i v2 03/08) - 1 User Commands A-M (vol 1)

f
find(1) find(1)
NAME
find - find files
SYNOPSIS
find pathname_list [expression ]
DESCRIPTION
The
find command recursively descends the directory hierarchy for each path name in pathname_list
(that is, one or more path names) seeking files that match a Boolean expression written in the primaries
given below. By default,
find does not follow symbolic links.
The Boolean expression is evaluated using short-circuit evaluation. This means that whenever the result
of a Boolean operation (AND or OR) is known from evaluating the left-hand argument, the right-hand
argument is not evaluated.
In the descriptions of the primaries, the argument n represents a decimal integer;
+n means more than n,
-n means less than n, and n means exactly n.
The following primaries are recognized:
-depth A position-independent term which causes descent of the directory hierarchy
to be done so that all entries in a directory are acted on before the directory
itself. This can be useful when find is used with cpio(1) to transfer files that
are contained in directories without write permission. It is also useful when
using cpio(1) and the modification dates of directories must be preserved.
Always true.
-follow A position-independent term which causes
find to follow symbolic links.
When following symbolic links,
find keeps track of the directories visited so
that it can detect infinite loops; for example, such a loop would occur if a sym-
bolic link pointed to an ancestor. This expression should not be used with the
-type l expression. Always true.
-fsonly FStype A position-independent term which causes
find to stop descending any direc-
tory whose file system is not of the type specified by FStype, where FStype is
one of
cdfs, hfs, vxfs,ornfs, representing the CDFS, HFS, JFS (VXFS)
or NFS file system type, respectively.
In this context, mount points inherit the FStype of their parent directory. This
means that when
-fsonly hfs has been specified and find encounters an
NFS mount point that is mounted on an HFS file system, the mount point will
be visited but entries below that mount point will not. It is important to note
that when -fsonly nfs has been specified, any HFS file systems that are
beneath the mount point of an NFS file system are not traversed. Always
true.
-local True if the file physically resides on the local system. This does not restrict
the search to only files which physically reside on the local system, it merely
matches such files. See EXAMPLES.
-xdev A position-independent term that causes find to avoid crossing any file sys-
tem 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.
-mountstop Identical to -xdev. This primary is provided for backward compatibility only.
-xdev is preferred over -mountstop.
-name file True if pattern file matches the last component of the current file name. Pat-
tern is matched according to Pattern Matching Notation for filename expan-
sion. Pattern should be escaped (using backslash) or quoted when find is
invoked from the shell, to prevent the shell from expanding any metacharac-
ters. Pattern may contain supplementary code set characters.
-path file Same as -name except the full path (as would be output by -print) is used
instead of just the base name. Note that / characters are not treated as a spe-
cial case. For example, */.profile matches ./home/fred/.profile.
HP-UX 11i Version 2: August 2003 1 Hewlett-Packard Company Section 1281