3 find \- find files meeting a given condition
5 \fBfind \fIdirectory \fIexpression\fR
18 .EX "find / \-name a.out \-print" "Print all \fIa.out\fR paths"
19 .EX "find /usr/ast ! \-newer f \-ok rm {} \e;" "Ask before removing"
20 .EX "find /usr \-size +20 \-exec mv {} /big \e^;" "move files > 10k"
21 .EX "find / \e( \-name a.out \-o \-name \(fm*.o\(fm \e) \-exec rm {} \e;" "2 conds"
24 \fIFind\fR descends the file tree starting at the given directory checking
25 each file in that directory and its subdirectories against a predicate.
26 If the predicate is true, an action is taken. The predicates may be
27 connected by \fB\-a\fR (Boolean and), \fB\-o\fR (Boolean or) and !
29 Each predicate is true under the conditions specified below. The integer
30 \fIn\fR may also be +\fIn\fR to mean any value greater than \fIn\fR,
31 \fI\-n\fR to mean any value less than
32 \fIn\fR, or just \fIn\fR for exactly \fIn\fR.
38 \-name s true if current filename is \fIs\fR (include shell wild cards)
40 \-size n true if file size is \fIn\fR blocks
42 \-inum n true if the current file's i-node number is \fIn\fR
44 \-mtime n true if modification time relative to today (in days) is \fIn\fR
46 \-links n true if the number of links to the file is \fIn\fR
48 \-newer f true if the file is newer than \fIf\fR
50 \-perm n true if the file's permission bits = \fIn\fR (\fIn\fR is in octal)
52 \-user u true if the uid = \fIu\fR (a numerical value, not a login name)
54 \-group g true if the gid = \fIg\fR (a numerical value, not a group name)
56 \-type x where \fIx\fR is \fBbcdfug\fR (block, char, dir, regular file, setuid, setgid)
58 \-xdev do not cross devices to search mounted file systems
63 Following the expression can be one of the following, telling what to do
70 \-print print the file name on standard output
72 \-print0 print the file name terminated by a null character, to be
77 \-exec execute a command, {} stands for the file name
79 \-ok prompts before executing the command