Repeated execution with find



Last revision July 20, 2004

Additional topics:

The find program is a general purpose program for selecting a subset of files within a directory tree according to specified criteria and then listing the files or executing a desired command upon each file in turn.

Syntax is:

find dirlist expressions

dirlist is a list of one or more directories. Each entire directory tree, including all its sub-directories and their sub-directories, etc., is searched for files specified by the expressions.

expressions is a set of one or more expressions. Expressions are used to limit the set of files that match the find operation, and to perform operations on those matching files.

Each expression may be thought of as a filter that optionally performs an action on all files that have passed all previous filters (expressions), and then perhaps makes further selections to reduce the number of files passed on to the next expression.

The order in which you specify expressions is thus important, since each further restricts the results of the previous ones. In addition to this default method of using multiple expressions (logical "and"), you can also specify a logical or operation, where a file is selected if it matches any one of a set of expressions.

Comments or Questions?