Wednesday 13 April 2011

Unix/Linux — Find files that contain a string

To find the files that contain a string we can use:
find . -exec grep -l “string to find” {} \;
This starts the search from the current directory, looks for files that  contain the specified string, and then it prints their names.