/ 中存储网

告诉你Ubuntu命令行查找文件和字符串的方法及命令

2015-06-07 23:02:03 来源:中存储网

Ubuntu命令行查找文件和字符串:

以查找字符串 isascii 为例:

find  -name *.cpp|xargs grep -rnws isascii

find  -name *.c|xargs grep -rnws isascii

find  -name *.h|xargs grep -rnws isascii

grep -rnws isascii . --include=*.h

grep -rnws isascii . --include=*.cpp

grep -rnws isascii .