# find命令的“-exec COMMAND \;”

``````# find . -name '*.stp' -exec ls {} \;
./Documents/one.stp
./Documents/two.stp
``````

find

-exec COMMAND \;

Carries out COMMAND on each file that find matches. The command sequence terminates with ; (the “;” is escaped to make certain the shell passes it to find literally, without interpreting it as a special character).

If COMMAND contains {}, then find substitutes the full path name of the selected file for “{}”.

`;`的作用是标示命令完结，`\;`是让`shell``;`原封不动地传给`find`命令。而`{}`会使用查找出来的文件的全路径名。

16.2. Complex Commands