Hi ric_Poirier.
All 'find' options return a logic value (true or false), and by default are 'and' together.
To improve performance, 'find' will not evaluate redundant expressions. For instance, if you have
Code:
expresion1 and expression2
If 'find' determines that expression1 is false, 'find' will skip evaluating expression2 because 'false and whatever' is always false.
Another example:
Code:
$ ls
not_this_file.txt this_file.txt
$ find -name '*file*' -name '*not*'
./not_this_file.txt
$ find -name '*file*' -o -name '*not*'
./this_file.txt
./not_this_file.txt
Note that by defualt 'find' would print the results, but if you explicitly ask for print, you are effectively adding another logical switch:
Code:
$ find -name '*file*' -o -name '*not*'
./this_file.txt
./not_this_file.txt
$ find -name '*file*' -o -name '*not*' -print
$
And that makes the case for parenthesis:
Code:
$ find \( -name '*file*' -o -name '*not*' \) -print
./this_file.txt
./not_this_file.txt
Does that help? Let us know if you have more questions.
Regards.
Bookmarks