FIND(1) DOMAIN/IX Reference Manual (SYS5) FIND(1)
NAME
find - find files
USAGE
find path-name-list expression
DESCRIPTION
Find recursively descends the directory hierarchy for each
pathname in the path-name-list, seeking files that match a
Boolean expression written in the primaries given below.
EXPRESSIONS
(In the descriptions below, the argument n is used as a
decimal integer where +n means more than n, -n means less
than n, and n means exactly n).
-name file True if file matches the current filename.
Normal Shell argument syntax may be used if
escaped, but watch out for [, ? and *.
-perm onum True if the file permission flags exactly
match the octal number onum. Information
about file permissions is found in chmod
(1). If onum is prefixed by a minus sign,
more flag bits (017777) become significant
and the flags are compared. See stat (2)
for details.
-type c True if the type of the file is c, where c
is b (block special file), c (character spe-
cial file), d (directory), p (FIFO, or named
pipe), or f (plain file).
-links n True if the file has n links.
-user uname True if the file belongs to the user uname.
If uname is numeric and does not appear as a
log-in name in the /etc/passwd file, it is
taken as a user ID.
-group gname True if the file belongs to the group gname.
If gname is numeric and does not appear in
the /etc/group file, it is taken as a group
ID.
-size n[c] True if the file is n blocks long (1024
bytes per block). If n is followed by a c,
the size is in characters.
-atime n True if the file has been accessed in n
days. The access time of directories in
path-name-list is changed by find itself.
Printed 6/10/85 FIND-1
FIND(1) DOMAIN/IX Reference Manual (SYS5) FIND(1)
-mtime n True if the file has been modified in n
days.
-ctime n True if the file has been changed in n days.
-exec cmd True if the executed cmd returns a zero
value as exit status. The end of cmd must
be punctuated by an escaped semicolon. A
command argument {} is replaced by the
current pathname.
-ok cmd Like -exec, except this prints the generated
command line with a question mark first, and
executes only if you respond by typing y.
-print Always true; print the current pathname.
-cpio device Always true; write the current file on dev-
ice in cpio (4) format (5120-byte records).
-newer file True if the current file has been modified
more recently than the argument file.
-depth Always true; descend the directory hierarchy
so that all entries in a directory are acted
on before the directory itself. Can be use-
ful when find is used with cpio (1) to
transfer files contained in directories
without write permission.
( expression ) True if a parenthetical expression is true
(parentheses are special to the Shell and
must be escaped).
OPERATORS
The primaries listed above may be combined using the follow-
ing operators (in order of decreasing precedence):
1) The negation of a primary (! is the unary not opera-
tor).
2) Concatenation of primaries (the and operation is implied
by the juxtaposition of two primaries).
3) Alternation of primaries (-o is the or operator).
EXAMPLE
To remove all files named a.out or *.o that have not been
accessed for a week:
find / ( -name a.out -o -name '*.o' )-atime +7 -exec
rm {} ;
FIND-2 Printed 6/10/85
FIND(1) DOMAIN/IX Reference Manual (SYS5) FIND(1)
FILES
/etc/passwd
/etc/group
RELATED INFORMATION
chmod (1), cpio (1), sh (1), test (1), stat (2), cpio (4).
Printed 6/10/85 FIND-3