find命令中的-a是什么意思

发布于 2024-11-16 21:39:32 字数 153 浏览 2 评论 0原文

find . -a -type f -a -name '*.txt'

我认为 -a 充当“​​&”测试之间。就像'expr1 &表达式2 &表达式3'。为什么如果我在路径和第一个表达式之间添加“-a”就可以正常工作?

find . -a -type f -a -name '*.txt'

I thought the -a acts as an "&" between tests. Like 'expr1 & expr2 & expr3'. Why does it work fine if I add a '-a' between the path and the first expression?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑咖 2024-11-23 21:39:32
   expr1 expr2
      Two expressions in a row are taken to be joined with an  implied
      "and"; expr2 is not evaluated if expr1 is false.

   expr1 -a expr2
      Same as expr1 expr2.

在路径和表达式的情况下,我猜这只是一个解析怪癖,什么也不做。

   expr1 expr2
      Two expressions in a row are taken to be joined with an  implied
      "and"; expr2 is not evaluated if expr1 is false.

   expr1 -a expr2
      Same as expr1 expr2.

In the case of the path and the expression, I'm guessing it's just a parsing quirk that does nothing.

春夜浅 2024-11-23 21:39:32

and 是默认值,所以我猜测 -a 会被简单地忽略,并且不会尝试一致地解析它。

and is the default, so I would guess that -a is simply ignored and no attempt is made to parse it consistently.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文