®nd(1)

®nd(1)

NAME

®nd - ®nd ®les

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 ®les 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, -nmeans 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 ®les that are con-

 

tained in directories without write permission. It is also useful when using

 

cpio(1) and the modi®cation 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 in®nite loops; for example, such a loop would occur if a symbolic 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 ®le system is not of the type speci®ed by FStype, where FStype is one

 

of cdfs, hfs, vxfs, or nfs, representing the CDFS, HFS, JFS (VXFS) or

 

NFS ®le system type, respectively.

 

In this context, mount points inherit the FStype of their parent directory. This

 

means that when -fsonly

hfs has been speci®ed and find encounters an

 

NFS mount point that is mounted on an HFS ®le 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 speci®ed, any HFS ®le systems that are beneath

 

the mount point of an NFS ®le system are not traversed. Always true.

-local

True if the ®le physically resides on the local system. This does not restrict the

 

search to only ®les which physically reside on the local system, it merely

 

matches such ®les. See EXAMPLES.

-xdev

A position-independent term that causes find to avoid crossing any ®le 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.

 

 

-mountstop

Identical to -xdev. This primary is provided for backward compatibility only.

 

-xdevis preferred over -mountstop.

-name file

True if ®le matches the last component of the current ®le name. The matching is

 

performed according to Pattern Matching Notation (see regexp(5)). Pattern may

 

contain supplementary code set characters.

-path file

Same as -nameexcept 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.

-perm [-]mode

In this primary, the argument mode is used to represent ®le mode bits. The

 

argument is identical in format to the mode operand as described in chmod(1),

 

with the exception that the ®rst character must not be the - operator. When

 

using the symbolic form of mode, the starting template is assumed to have all

 

®le mode bits cleared.

 

HP-UX Release 11i: December 2000

− 1 −

Section 1271

f