find命令使用exec参数报错:missing argument to “-exec”

·

这个错误其实是参数格式写错导致的。
例如:

find /root -name file -exec ls -l {}\;

这样写就会报错,修改为以下形式就不会报错了:

find /root -name file -exec ls -l {} \;                //{}和\之间多了一个空格。

看到网上有很多文章说解决这条错误的方法可以是给{}\;加上双引号变为”{}\;”,这个解决方法笔者使用CentOS 6.5亲测无效。

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha Code