最近在研究linux下的shell。我有一个问题。
请看下面的命令:
$ find . -name '*.c' -or -name '*.cpp'
上面命令的确切命令像下面命令一样处理?
$ find . -name '*.c' -and -print -or -name '*.cpp' -and -print
最佳答案
您正在使用逻辑运算符 or
组合不同的搜索表达式。
基本上,您的命令会找到当前目录中以 .c
或 .cpp
结尾的所有文件,并将它们打印到 STDOUT
。
有关详细信息,请查看 find
命令的 man
页面。
另请注意,这个问题更适合问 here .
关于linux - 我想知道 "find . -name ' *.c' -or -name '*.cpp' "在 Linux 中的确切命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46392375/