bash - 找到 exec ls : No such file or directory

标签 bash shell find ls

我尝试执行:

找到 ~/-name "*foo*"-exec "ls -la {}"\;

它打印了:

find: 'ls -la /home/users/MyUser/fooBar': No such file or directory

find: 'ls -la /home/users/MyUser/Barfoo': No such file or directory

此外,lsls --color 的别名。

这里发生了什么诡计?

最佳答案

-exec 的参数不应被引用。删除 -exec 后的引号。并且 -exec 不会检测别名,因此您需要将 --color 选项传递给 exec。

关于bash - 找到 exec ls : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55709940/

相关文章:

Linux Bash - 如何使用 ()、&& 和 & 执行以下操作

linux - Bash 终端和颜色输出

检查C中的输入流是否为空

linux - 查找路径不包含单词的文件

bash - -exec wc -l {}\;打印计数和路径,我只需要计数

bash - 将 Bash 字符串文字与局部变量进行比较

python - 使用awk根据某些行中的值过滤文本文件

javascript - 在js脚本中获取mongodb数据类型

regex - Perl 使用哪种 POSIX 风格的正则表达式?

Java:在字符串中查找字符串