【问题标题】:I want to know exact command of "find . -name '*.c' -or -name '*.cpp'" in Linux我想知道 Linux 中“find . -name '*.c' -or -name '*.cpp'” 的确切命令
【发布时间】:2017-09-24 16:38:50
【问题描述】:

这些天我正在研究 Linux 中的 shell。我有一个问题。

请看下面的命令:

$ find . -name '*.c' -or -name '*.cpp'

上面命令的具体命令是否像下面的命令一样处理?

$ find . -name '*.c' -and -print -or -name '*.cpp' -and -print

【问题讨论】:

    标签: linux find command


    【解决方案1】:

    您正在使用逻辑运算符or 组合不同的搜索表达式。 基本上,您的命令将在当前目录中找到以.c 或.cpp 结尾的所有文件,并将它们打印到STDOUT。 如需更多信息,请查看find 命令的man 页面。 另请注意,这个问题更适合问here。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-06
      • 1970-01-01
      • 2019-08-25
      • 1970-01-01
      • 1970-01-01
      • 2018-04-24
      • 1970-01-01
      相关资源
      最近更新 更多