本文介绍了查找:-exec 缺少参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天得到了一个命令的帮助,但它似乎不起作用.这是命令:

I was helped out today with a command, but it doesn't seem to be working. This is the command:

find /home/me/download/ -type f -name "*.rm" -exec ffmpeg -i {} -sameq {}.mp3 && rm {};

外壳返回

find: missing argument to `-exec'

我基本上想做的是递归地遍历一个目录(如果它有其他目录)并在 .rm 文件类型上运行 ffmpeg 命令并将它们转换为 .mp3 文件类型.完成此操作后,删除刚刚转换的 .rm 文件.

What I am basically trying to do is go through a directory recursively (if it has other directories) and run the ffmpeg command on the .rm file types and convert them to .mp3 file types. Once this is done, remove the .rm file that has just been converted.

感谢您对此提供的任何帮助.

I appreciate any help on this.

推荐答案

我现在想通了.当您需要在 exec 中运行两个命令时,您实际上需要有两个单独的 exec.这终于对我有用了.

I figured it out now. When you need to run two commands in exec in a find you need to actually have two separate execs. This finally worked for me.

find . -type f -name "*.rm" -exec ffmpeg -i {} -sameq {}.mp3 ; -exec rm {} ;

这篇关于查找:-exec 缺少参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 16:04