The basic syntax
List all files which contain a text pattern (recursively):
grep -r -H '{pattern}' {directory}
Examples of common use
List all files containing <html> in current user’s public_html directory:
grep -r -H '<html>' ~/public_html/
List all files which contain a text pattern (recursively):
grep -r -H '{pattern}' {directory}
List all files containing <html> in current user’s public_html directory:
grep -r -H '<html>' ~/public_html/