linux在所有文件中查找某一个字符

# find <directory> -type f -name "*.c" | xargs grep "<strings>"

<directory>是你要找的文件夹;如果是当前文件夹可以省略
-type f 说明,只找文件
-name "*.c" 表示只找C语言写的代码,从而避免去查binary;也可以不写,表示找所有文件
<strings>是你要找的某个字符串

sudo find -type f -name '*'|xargs grep 'ssi on'

上一篇:struts1 和 struts2中Action什么时候实例化


下一篇:python简介