$ find . -iname "*dbg*" -exec rename _dbg.txt .txt '{}' \;
@H_301_2@
什么'{}'@H_301_2@和
\;@H_301_2@是谁?
该-exec@H_301_2@参数使find
rename@H_301_2@对找到的每个匹配文件执行。
'{}'@H_301_2@将被替换为文件的路径名。最后一个标记
\;@H_301_2@仅用于标记exec表达式的结尾。
手册页中对找到的所有内容进行了很好的描述:
-exec utility [argument ...] ;
True if the program named utility returns a zero value as its
exit status. Optional arguments may be passed to the utility.
The expression must be terminated by a semicolon (``;''). If you
invoke find from a shell you may need to quote the semicolon if
the shell would otherwise treat it as a control operator. If the
string ``{}'' appears anywhere in the utility name or the argu-
ments it is replaced by the pathname of the current file.
Utility will be executed from the directory from which find was
executed. Utility and arguments are not subject to the further
expansion of shell patterns and constructs.
@H_301_2@