如何在谓词“-exec”之后找到可能的未引用模式?

How to find possible unquoted pattern after predicate `-exec'?

我有 5 个文件要解压(我解压了很多次):

find . -name "*.rar"
./Udemy_Kubernetes_Mastery_Hands-On_Lessons_From_A_Docker_Captain_2020-4.part5_Downloadly.ir.rar
./Udemy_Kubernetes_Mastery_Hands-On_Lessons_From_A_Docker_Captain_2020-4.part2_Downloadly.ir.rar
./Udemy_Kubernetes_Mastery_Hands-On_Lessons_From_A_Docker_Captain_2020-4.part4_Downloadly.ir.rar
./Udemy_Kubernetes_Mastery_Hands-On_Lessons_From_A_Docker_Captain_2020-4.part1_Downloadly.ir.rar
./Udemy_Kubernetes_Mastery_Hands-On_Lessons_From_A_Docker_Captain_2020-4.part3_Downloadly.ir.rar

我的命令

find . -name "*.rar" -exec unrar x -o+ \; Udemy_Kubernetes_Mastery_Hands-On_Lessons_From_A_Docker_Captain_2020-4.part1_Downloadly.ir.rar 

我遇到错误

find: paths must precede expression: `Udemy_Kubernetes_Mastery_Hands-On_Lessons_From_A_Docker_Captain_2020-4.part1_Downloadly.ir.rar'
find: possible unquoted pattern after predicate `-exec'?

为什么?

将您的命令更改为:

find . -name "*.rar" -exec unrar x -o+ {} \;

其中{}表示find命令找到的文件。