Skip to main content

Find files with Name X containing Text Y

Useful and fast:

find -type f -name 'filename' -exec grep -H 'text to find' {} +

Same result and maybe even better performance:

grep -rnw --include="filename" . -e 'text to find'

Works as well and is very fast:

grep -inr --include='filename' 'text to find'