GNU Info

Info Node: (find.info)Single File

(find.info)Single File


Next: Multiple Files Up: Run Commands
Enter node , (file) or (file)node

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 ';'


automatically generated by info2www version 1.2.2.9