admin管理员组

文章数量:1558098

Use grep to search certain content in  the specified sub-directory.

reference url:

From: http://www.ai7/wp/html/653.html

grep -r abcd *.py

Use above command can not get the expected result

grep -r abcd *

Use above command the result is too big,and also is not expected.


Best method is:

find . -name *.py|xargs grep asdf

another method is below:

find . -iname ‘*’ -exec grep -nH ‘{}’ \;

this method is too complicated.

本文标签: SearchgrepdirectoryContent