Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (d - f)
find(1)
all of its subdirectories. This search may take a while, so it is best to limit the search by
specifying the directories where you think the files might be.
2. To list the files with a specific permission code in the current directory tree, enter:
find . -perm 0600
This command lists the names of the files that have only owner-read and owner-write per-
mission. The . (dot) tells the find command to search the current directory and its sub-
directories. See the reference page for the chmod command for details about permission
codes. Alternatively, you could enter the following:
find . -perm u+rw
3. To search several directories for files with certain permission codes, enter:
find manual clients proposals -perm -0600
This command lists the names of the files that have owner-read and owner-write permis-
sion and possibly other permissions. The directories manual, clients, and proposals, and
their subdirectories, are searched. Note that the expression -perm 0600 in the previous
example selects only files with permission codes that match 0600 exactly. In this exam-
ple, the expression -perm -0600 selects files with permission codes that allow at least the
accesses indicated by 0600. This command also matches the permission codes 0622 and
2744.
4. To search for regular files with multiple links, enter:
find . -type f -links +1
This lists the names of the ordinary files (-type f) that have more than one link (-links +1).
Note that every directory has at least two links: the entry in its parent directory and its
own . (dot) entry. See the reference page for the ln command for details about multiple
file links.
5. To search for the file f1 among the OSS files on the remote node node1,enter:
export UTILSGE=NOG
find /E/node1 -name f1 -print
6. To search for the file f1 among the OSS files on the local node, enter:
find / -W NOG -W NOE -name f1 -print
NOTES
Because /G and /E both appear in your local root directory, you should be very careful when using
OSS shell commands on or from the root directory. OSS shell commands that perform recursive
actions make no distinction between Guardian and OSS files or between local and remote files.
You can use the -W NOG and -W NOE flags or the UTILSGE environment variable to exclude
objects in the Guardian file system or objects accessible through the Expand product.
EXIT VALUES
The find command returns a 0 (zero) if all the paths are visited without error. The find command
returns a nonzero value if it encounters an error.
RELATED INFORMATION
Commands: chmod(1), grep(1), ln(1), sh(1), test(1).
Functions: stat(2).
527188-003 Hewlett-Packard Company 3−141