找到-exec选项 [英] find -exec option
本文介绍了找到-exec选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说,我想找到一些文件,做chmod和用它做一些与另一个命令,如:
Say , i want to find some files and do chmod and do something with it with another command, eg
find . -name "*.txt" -exec chmod 666 "{}" && cp "{}" /dst \;
它说:
find: missing argument to `-exec'
我如何正确使用本 -exec
结构?我认为这个问题是与&放大器;&安培; ?我需要使用此&放大器;&安培;
运算符的情况下,搭配chmod
失败
谢谢
How do I properly use this -exec
construct? I think the problem is with the "&&" ? I need to use this &&
operator in case chmod
fails
thank you
推荐答案
只需使用另一个 -exec
例如
find . -name \*.txt -exec chmod 666 {} \; -exec cp {} /dst/ \;
这篇关于找到-exec选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文