前言:我理解-exec {} \;&之间的区别-exec {} +。我也没有问题,因为这样,我只是好奇的语义find。
当-exec以+而不是结束参数时;,我们需要以 结束{} +,例如:
# FreeBSD find
$ find . -type f -exec cp {} /tmp +
find: -exec: no terminating ";" or "+"
# GNU find is even more cryptic:
$ find: missing argument to `-exec'
Run Code Online (Sandbox Code Playgroud)
;在这些示例中使用而不是+工作正常(但显然做了其他事情)。
从POSIX:
-exec utility_name [argument ...] ;
-exec utility_name [argument ...] {} +... …