Manual Page Result
0
Command: find | Section: 1 | Source: UNIX v10 | File: find.1
FIND(1) General Commands Manual FIND(1)
NAME
find - find files
SYNOPSIS
find pathname ... expression
DESCRIPTION
Find recursively descends the directory hierarchy for each pathname,
seeking files that match a boolean expression, which consists of one or
more arguments. It does not follow symbolic links. In the following
descriptions of primary expressions, n is a decimal integer; +n may be
written to specify more than n and -n to specify less.
-name filename
True if the filename argument matches the current file name.
Normal shell filename metacharacters may be used if quoted.
-perm onum
True if the file permission flags exactly match the octal
number onum (see chmod(1)). If onum is prefixed by a minus
sign, more mode bits (017777, see stat(2)) become significant
and the modes are compared: (mode&onum)==onum.
-type c True if the type of the file is c, where c is b, c, d, f, or
L for block special file, character special file, directory,
plain file or symbolic link.
-links n True if the file has n links.
-user uname
True if the file belongs to the user uname (login name or nu-
meric userid).
-group gname
True if the file belongs to group gname (group name or nu-
meric groupid).
-size n True if the file is n blocks long (512 bytes per block).
-inum n True if the file has inode number n.
-atime n True if the file has been accessed in n days.
-mtime n True if the file has been modified in n days.
-ctime n True if the inode has been changed in n days.
-exec command
True if the executed command returns a zero value as exit
status. The end of the command must be punctuated by an es-
caped semicolon. A command argument is replaced by the cur-
rent pathname.
-ok command
Like -exec except that the generated command is written on
the standard output, then the standard input is read and the
command executed only upon response y.
-print Always true; causes the current pathname to be printed.
-newer file
True if the file has been modified more recently than the ar-
gument file.
-status n True if lstat (see stat(2)) applied to the file yields error
number n; see intro(2). Testing turns off diagnostics that
errors normally produce. On ordinary systems a nonzero error
number occurs when a file disappears underfoot or a file sys-
tem is in trouble.
The following operators, listed in order of decreasing precedence, may
be used to combine primary expressions.
( expression )
Group with parentheses.
! expression
Negation. True if and only if expression is not true.
expression expression
Conjunction. True if both expressions are true.
expression -o expression
Disjunction. True if either expression is true.
EXAMPLES
find / \( -name a.out -o -name '*.o' \) -atime +7 -exec rm '{}' \;
Remove all files named or that have not been accessed for a
week.
FILES
SEE ALSO
sh(1), test(1), filsys(5)
FIND(1)