www.delorie.com/gnu/docs/findutils/find_24.html   search  
 
Buy GNU books!


Finding Files

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.11 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.

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.

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.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)