find: find Expressions
1
1 1.3 'find' Expressions
1 ======================
1
1 The expression that 'find' uses to select files consists of one or more
1 "primaries", each of which is a separate command line argument to
1 'find'. 'find' evaluates the expression each time it processes a file.
1 An expression can contain any of the following types of primaries:
1
1 "options"
1 affect overall operation rather than the processing of a specific
1 file;
1 "tests"
1 return a true or false value, depending on the file's attributes;
1 "actions"
1 have side effects and return a true or false value; and
1 "operators"
1 connect the other arguments and affect when and whether they are
1 evaluated.
1
1 You can omit the operator between two primaries; it defaults to
1 '-and'. ⇒Combining Primaries With Operators, for ways to connect
1 primaries into more complex expressions. If the expression contains no
1 actions other than '-prune', '-print' is performed on all files for
1 which the entire expression is true (⇒Print File Name).
1
1 Options take effect immediately, rather than being evaluated for each
1 file when their place in the expression is reached. Therefore, for
1 clarity, it is best to place them at the beginning of the expression.
1 There are two exceptions to this; '-daystart' and '-follow' have
1 different effects depending on where in the command line they appear.
1 This can be confusing, so it's best to keep them at the beginning, too.
1
1 Many of the primaries take arguments, which immediately follow them
1 in the next command line argument to 'find'. Some arguments are file
1 names, patterns, or other strings; others are numbers. Numeric
1 arguments can be specified as
1
1 '+N'
1 for greater than N,
1 '-N'
1 for less than N,
1 'N'
1 for exactly N.
1