为四川人民祈祷! www.onefoundation.cn

grep for project search

本来是 --help 就可以看到的东西
grep 'xxx' .
在当前目录查找文件中的内容

grep 'xxx' . -r
在当前目录下的所有目录查找文件内容

grep 'xxx' . -r -n
输出结果加行号

grep 'xxx' . -r -n --include="*.py"
在当前目录下的所有目录中, 查找.py文件的内容

grep 'xxx' . -r -n --include="*.py" --exclude="__init__.py"
排除某些文件

已经够用了

传说中还有一个ack, perl写的, 输出结果比grep漂亮, 不过使用中缺少一些灵活的选项.
 
by kernel1983
Comments »
Leave a Comment:
code:601