相关疑难解决方法(0)

为什么“find -exec cmd {} +”需要以“{} +”结尾?

前言:我理解-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 ...] {} +

... …

find history posix

12
推荐指数
1
解决办法
3608
查看次数

标签 统计

find ×1

history ×1

posix ×1