linux查找目录下的所有文件中是否含有某个字符串

https://www.cnblogs.com/keystone/articles/10653163.html

方法一:

  grep   -rn   "要查找的字符串"    *

  -r 是递归查找

  -n 是显示行号

  * : 表示当前目录所有文件,也可以是某个文件名

方法二:

  find .|xargs grep “要查找的字符串”

  find . -exec grep “要查找的字符串” {} \;

  find / -name "要查找的字符串"

  find / -name "要查找的字符串"

原文地址:https://www.cnblogs.com/zhoading/p/15739837.html