How can I grep in source files for some text?
What's the command to search for specific text in specific file types, recursively, under the current directory?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
find . -type f -name '*.extension' | xargs grep "string"
This command runs find on the local directory (.) for any files with names matching the pattern *.extension, then runs grep for "string" on the results of the find. Note that find is inherently recursive. As long as you can differentiate the files that you want from the files you don't based on name, this should work for you.