Combining other commands with the find command

You can also use the find command to find a file and then carry out a command on that file. To do this use the command:

   find pathname -name filename -print -exec command {}\;

To be prompted for confirmation before the command is executed use the command:

   find pathname -name filename -print -ok command {}\;

The command must be followed by a \ (backslash) and a ; (semi-colon). The {} (pair of braces) substitute the pathname of the file that is found as an argument to the command.


[Home] [Search] [Index] This site maintained by webmaster@cs.auckland.ac.nz