find: Combining Primaries With Operators
2.12 Combining Primaries With Operators
=======================================
Operators build a complex expression from tests and actions. The
operators are, in order of decreasing precedence:
'( EXPR )'
Force precedence. True if EXPR is true.
'! EXPR'
'-not EXPR'
True if EXPR is false. In some shells, it is necessary to protect
the '!' from shell interpretation by quoting it.
'EXPR1 EXPR2'
'EXPR1 -a EXPR2'
'EXPR1 -and EXPR2'
And; EXPR2 is not evaluated if EXPR1 is false.
'EXPR1 -o EXPR2'
'EXPR1 -or EXPR2'
Or; EXPR2 is not evaluated if EXPR1 is true.
'EXPR1 , EXPR2'
List; both EXPR1 and EXPR2 are always evaluated. True if EXPR2 is
true. The value of EXPR1 is discarded. This operator lets you do
multiple independent operations on one traversal, without depending
on whether other operations succeeded. The two operations EXPR1
and EXPR2 are not always fully independent, since EXPR1 might have
side effects like touching or deleting files, or it might use
'-prune' which would also affect EXPR2.
'find' searches the directory tree rooted at each file name by
evaluating the expression from left to right, according to the rules of
precedence, until the outcome is known (the left hand side is false for
'-and', true for '-or'), at which point 'find' moves on to the next file
name.
There are two other tests that can be useful in complex expressions:
-- Test: -true
Always true.
-- Test: -false
Always false.