使用grep进行搜索

使用grep进行搜索,grep,Grep,嘿,伙计们,我只是想看看有没有人能帮我。 我试图递归搜索一个目录,以找到一个扩展名为.poem并包含“I”的文件 当我这样做的时候 grep -r -e --include *.poem I 我没有显示任何内容仅返回文件名: grep --include "*.poem" -R I . grep -r -H "I" yourdir --include *.poem | cut -d: -f1 | uniq -u 用目录替换yourdir。如何添加特定目录?有3个子目录吗?将更改为该目录;

嘿,伙计们,我只是想看看有没有人能帮我。 我试图递归搜索一个目录,以找到一个扩展名为.poem并包含“I”的文件

当我这样做的时候

grep -r -e --include *.poem I

我没有显示任何内容

仅返回文件名:

grep --include "*.poem" -R I .
 grep -r -H "I" yourdir --include *.poem | cut -d: -f1 | uniq -u

用目录替换yourdir。

如何添加特定目录?有3个子目录吗?将
更改为该目录;使用
--包含目录
。谢谢!非常感谢!我似乎总是忘记了过去。或者我要搜索的目录