Go to the first, previous, next, last section, table of contents.


Single File

Here is how to run a command on one file at a time.

Action: -exec command ;
Execute command; true if 0 status is returned. find takes all arguments after `-exec' to be part of the command until an argument consisting of `;' is reached. It replaces the string `{}' by the current file name being processed everywhere it occurs in the command. Both of these constructions need to be escaped (with a `\') or quoted to protect them from expansion by the shell. The command is executed in the directory in which find was run.

For example, to compare each C header file in the current directory with the file `/tmp/master':

find . -name '*.h' -exec diff -u '{}' /tmp/master ';'


Go to the first, previous, next, last section, table of contents.