(find.info)find Expressions


Prev: Overview Up: Introduction
Enter node , (file) or (file)node

1.3 'find' Expressions
======================

The expression that 'find' uses to select files consists of one or more
"primaries", each of which is a separate command line argument to
'find'.  'find' evaluates the expression each time it processes a file.
An expression can contain any of the following types of primaries:

"options"
     affect overall operation rather than the processing of a specific
     file;
"tests"
     return a true or false value, depending on the file's attributes;
"actions"
     have side effects and return a true or false value; and
"operators"
     connect the other arguments and affect when and whether they are
     evaluated.

   You can omit the operator between two primaries; it defaults to
'-and'.  Note: Combining Primaries With Operators, for ways to connect
primaries into more complex expressions.  If the expression contains no
actions other than '-prune', '-print' is performed on all files for
which the entire expression is true (Note: Print File Name).

   Options take effect immediately, rather than being evaluated for each
file when their place in the expression is reached.  Therefore, for
clarity, it is best to place them at the beginning of the expression.
There are two exceptions to this; '-daystart' and '-follow' have
different effects depending on where in the command line they appear.
This can be confusing, so it's best to keep them at the beginning, too.

   Many of the primaries take arguments, which immediately follow them
in the next command line argument to 'find'.  Some arguments are file
names, patterns, or other strings; others are numbers.  Numeric
arguments can be specified as

'+N'
     for greater than N,
'-N'
     for less than N,
'N'
     for exactly N.


automatically generated by info2www version 1.2.2.9