DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Grep All Files Of A Certain File Type For A Specific Pattern

11.28.2011
| 3502 views |
  • submit to reddit
        For example to scan all .cs files for "PATTERN"

find . -type f -name '*.cs' -print0 | xargs -0 grep --color=always -n PATTERN