-exec command {} +
This variant of the -exec option runs the specified command on
the selected files, but the command line is built by appending
each selected file name at the end; the total number of invoca-
tions of the command will be much less than the number of
matched files. The command line is built in much the same way
that xargs builds its command lines. Only one instance of '{}'
is allowed within the command. The command is executed in the
starting directory.
来自
man find
:所以它会调用命令:
如果文件数量超出参数列表的容量,
rm
则将多次调用。(这就是这样xargs
做的。)没有它,
{} +
它只会调用rm
很多次而没有参数。该
{}
位是exec
命令的占位符。find 找到的任何文件都将插入以代替括号。建立一长串找到的文件并立即对所有文件调用 exec的方法,而不是像更传统的变体+
那样一次一个。-exec {} \;