.-- .. - .... .-.. --- ...- .

home archive about

Grep a string pattern from a large source code repository

30 Mar 2017

Ever in a situation when you want to find files containing some string pattern, from a large source code repository with tons of text files, binarys, and also hidden directories?

Try the following command:

cd the-repository-directory/
find . \( -path ./.idea -o -path ./.git -o -path ./.github \) -prune -o \
    -type f -exec grep -I your-string-here {} +

where .idea, .git, and .github are common hidden directories that you usually don't want to look into.

Creative Commons License

comments powered by Disqus