Unix and Linux Discussions Tagged with find -exec |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
4 |
5,855 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
12,523 |
Shell Programming and Scripting |
|
|
|
5 |
4,726 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
1,777 |
Shell Programming and Scripting |
|
|
|
12 |
4,396 |
Shell Programming and Scripting |
|
|
|
6 |
8,637 |
AIX |
|
|
|
3 |
5,359 |
Shell Programming and Scripting |
|
|
|
4 |
3,264 |
Shell Programming and Scripting |
|
|
|
2 |
3,195 |
UNIX for Dummies Questions & Answers |
|
|
|
19 |
5,184 |
Shell Programming and Scripting |
|
|
|
1 |
2,702 |
SuSE |
|
|
|
2 |
2,733 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
2,171 |
Shell Programming and Scripting |
|
|
|
7 |
3,673 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
44,269 |
Shell Programming and Scripting |
|
|
|
4 |
6,393 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
27,517 |
Shell Programming and Scripting |
|
|
|
1 |
9,876 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,380 |
Shell Programming and Scripting |
|
|
|
3 |
11,694 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
13,200 |
UNIX for Dummies Questions & Answers |
|
|
|
7 |
30,436 |
UNIX for Dummies Questions & Answers |
|
|
|
7 |
29,760 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
7,052 |
Shell Programming and Scripting |
|
|
|
4 |
9,823 |
UNIX for Dummies Questions & Answers |
FIND(1) General Commands Manual FIND(1)
NAME
find - find files meeting a given condition
SYNOPSIS
find directory expression
EXAMPLES
find / -name a.out -print
# Print all a.out paths
find /usr/ast ! -newer f -ok rm {} ;
# Ask before removing
find /usr -size +20 -exec mv {} /big ;
# move files > 20 blks
find / -name a.out -o -name '*.o' -exec rm {};
# 2 conds
DESCRIPTION
Find descends the file tree starting at the given directory checking each file in that directory and its subdirectories against a predi-
cate. If the predicate is true, an action is taken. The predicates may be connected by -a (Boolean and), -o (Boolean or) and ! (Boolean
negation). Each predicate is true under the conditions specified below. The integer n may also be +n to mean any value greater than n, -n
to mean any value less than n, or just n for exactly n.
-name s true if current filename is s (include shell wild cards)
-size n true if file size is n blocks
-inum n true if the current file's i-node number is n
-mtime ntrue if modification time relative to today (in days) is n
-links ntrue if the number of links to the file is n
-newer ftrue if the file is newer than f
-perm n true if the file's permission bits = n (n is in octal)
-user u true if the uid = u (a numerical value, not a login name)
-group gtrue if the gid = g (a numerical value, not a group name)
-type x where x is bcdfug (block, char, dir, regular file, setuid, setgid)
-xdev do not cross devices to search mounted file systems
Following the expression can be one of the following, telling what to do when a file is found:
-print print the file name on standard output
-exec execute a MINIX command, {} stands for the file name
-ok prompts before executing the command
SEE ALSO
test(1), xargs(1).
FIND(1)