Linux查找

1.在某个路径下查找所有包含“hello abcserver”字符串的文件。
例子:  find . -name "*proc*"
find /etc -name “*” | xargs grep “hello abcserver”
或者find /etc -name “*” | xargs grep “hello abcserver” > ./cqtest.txt

2.用来搜索test.c里是否包含字符串main
grep "main" -nR *

或者 grep main -nR *.cpp





原文地址:https://www.cnblogs.com/linux-wang/p/8142894.html