Mes*_*ing 2 linux shell terminal ubuntu command
我正在使用 Ubuntu。我必须在多个生成文件中搜索“发送”一词。假设所有的 makefile 都在 /home/mypath 中。我试过这个命令但不起作用。请你帮助我好吗?提前致谢。
find /home/mypath/ -name Makefile && grep -r "send"
Run Code Online (Sandbox Code Playgroud)
您可以使用以下命令send在所有Makefiles
递归中查找关键字。
find /home/mypath -name "Makefile" | xargs grep -r "send"
Run Code Online (Sandbox Code Playgroud)
这里的find命令列出Makefile了指定目录下所有同名的文件。xargs命令会将列出的所有文件以串行方式传递给grep命令以搜索字符串send