Find and list files containing a string

Recursively search all files matching a regexp in the current directory and then listing them.

find . -type f -name "*.file" | xargs grep -l "STRING"

This could also be done like this:

find . -type f -name "*.file" --exec grep -l "STRING" {} \;


Posted

in

by

Tags: