linux目录下查找

在linux某目录下查找包含某个字符串的文件:

grep -r pattern dir

其中pattern为要查找的模式,形式为正则表达式,dir是要查找的目录。

例如:

grep -r function\ curlFetchHtml* /home/sanshao/root/spider/

就是查找函数curlFetchHtml。。的定义,空格需要转义,*表示通配符。

原文地址:https://www.cnblogs.com/macula7/p/1960382.html