Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何使用grep和strings在多个文件中搜索单个单词或短语?_Linux_Search_Command - Fatal编程技术网

Linux 如何使用grep和strings在多个文件中搜索单个单词或短语?

Linux 如何使用grep和strings在多个文件中搜索单个单词或短语?,linux,search,command,Linux,Search,Command,我试图在多个文件中寻找像“数字”这样的单词,而不仅仅是使用终端的txt文件。我尝试过字符串-r/media/E016-5484/*| grep number,但仍然不起作用 假设您正在查找名称中包含file\u模式的所有文件中的1234 grep 1234 ` find . -name "*file_pattern*"` 或 假设您正在查找名称中包含file_模式的所有文件中的1234 grep 1234 ` find . -name "*file_pattern*"` 或 如果我没弄错

我试图在多个文件中寻找像“数字”这样的单词,而不仅仅是使用终端的txt文件。我尝试过字符串-r/media/E016-5484/*| grep number,但仍然不起作用

假设您正在查找名称中包含file\u模式的所有文件中的1234

 grep 1234 ` find . -name "*file_pattern*"`


假设您正在查找名称中包含file_模式的所有文件中的1234

 grep 1234 ` find . -name "*file_pattern*"`


如果我没弄错的话,你是在找我
grep号码-r/media/E016-5484

从手册页:

-r、 --递归的

仅当符号链接位于命令行上时,才按照符号链接递归读取每个目录下的所有文件。这相当于-d recurse选项


如果我没弄错的话,你是在找我
grep号码-r/media/E016-5484

从手册页:

-r、 --递归的

仅当符号链接位于命令行上时,才按照符号链接递归读取每个目录下的所有文件。这相当于-d recurse选项


我在文件中寻找模式,而不是文件名的模式。例如,我在很多文件的文本中寻找鲍勃。我还需要找到它所在的文件路径。我在寻找文件中的模式,而不是文件名的模式。例如,我在很多文件的文本中寻找鲍勃。我还需要找到它所在的文件路径。