HP-UX Reference (11i v2 07/12) - 1 User Commands A-M (vol 1)
f
find(1) find(1)
-newer[tv1[tv2]] file True if the indicated time value (tv1) of the current file is newer than the indi-
cated time value (tv2)offile. The time values tv1 and tv2 are each selected from
the set of characters:
a The time the file was last accessed
c The time the inode of the file was last modified
m The time the file was last modified
If the tv2 character is omitted, it defaults to
m. Note that the -newer option is
equivalent to
-newermm.
Syntax examples;
-newera file
-newermc file
-inum n True if the file serial number (inode number) is n. Note that file serial numbers
are unique only within a given file system. Therefore, matching file serial
numbers does not guarantee that the referenced files are the same unless you
restrict the search to a single file system.
-linkedto path True if the file is the same physical file as the file specified by path (i.e., linked to
path). This primary is similar to
-inum, but correctly detects when a file is
hard-linked to path, even when multiple file systems are searched.
-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.
-exec cmd True if the executed cmd returns a zero value as exit status. The end of cmd
must be punctuated by a semicolon (
;) or a plus sign (+) (semicolon and plus are
special to the shell and must be escaped). When
+ is used, cmd aggregates a set
of path names and executes on the set. Any command arguments between the
first occurrence of {} and + are ignored. The reason for preferring + to a
; is
vastly improved performance. Any command argument
{} is replaced by the
current path name. cmd may contain supplementary code set characters.
-ok cmd Same as -exec except that the generated command line is printed with a ques-
tion mark first, and is executed only if the user responds by typing y. The form
of the affirmative response is locale dependent: y in the C locale, see
LANG
on
environ(5). The end of cmd must be punctuated by a semicolon (
;) (semicolon is
special to the shell and must be escaped). cmd may contain supplementary code
set characters.
-cpio device Write the current file on device in cpio(4) format (5120-byte records). The use of
-cpio implies -depth. Always true.
-ncpio Same as -cpio but adds the -c option to cpio. The use of -ncpio implies
-depth. Always true.
-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.
-only This is a positive-logic version of -prune.A-prune is performed after every
directory, unless -only is successfully evaluated for that directory. As an
example, the following three commands are equivalent:
find . -fsonly hfs -print
find . -print -fstype hfs -only
find . -print ! -fstype hfs -prune
Note, however, that -only is useless if the -depth option has also been given.
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 \).
HP-UX 11i Version 2: December 2007 Update − 3 − Hewlett-Packard Company 345