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

f
find(1) find(1)
find pathname -type f -print | xargs chmod 444
find pathname -type d -print | xargs chmod 555
Note that output from find was piped to xargs(1) instead of using the
-exec primary. This is
because when a large number of files or directories is to be processed by a single command, the
-exec primary spawns a separate process for each file or directory, whereas xargs collects file
names or directory names into multiple arguments to a single chmod command, resulting in fewer
processes and greater system efficiency. The
+ delimiter for the -exec primary can be used to
achieve the same efficiency.
Access Control List Examples
Find all files not owned by user
karl that have access control lists with at least one entry associated with
karl, and one entry for no specific user in group
bin with the read bit on and the write bit off:
find / ! -user karl -acl ’karl.*, %.bin+r-w’ -print
Find all files that have a read bit set in any access control list entry:
find / -acl ’*.*+r’ -print
Find all files that have the write bit unset and execute bit set in every access control list entry:
find / -acl ’=*.*-w+x’ -print
Find all files that have optional access control list entries:
find / -acl opt -print
DEPENDENCIES
NFS
The -acl primary is always false for NFS files.
WARNINGS
Because of interoperability goals,
cpio does not support archiving files larger than 2GB or files that have
user/group IDs larger than 60,000 (60K). Files with user/group IDs greater than 60K are archived and
restored under the user/group ID of the current process.
AUTHOR
find was developed by AT&T and HP.
FILES
/etc/group Group names
/etc/mnttab Mount points
/etc/passwd User names
SEE ALSO
chacl(1), chmod(1), cpio(1), setacl(1), sh(1), test(1), xargs(1), mknod(2), stat(2), cpio(4), group(4),
passwd(4), acl(5), aclv(5), environ(5), lang(5), regexp(5).
STANDARDS CONFORMANCE
find: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
HP-UX 11i Version 2: September 2004 6 Hewlett-Packard Company Section 1303