If you strictly want to use find then use find + grep:
find /path/to/somewhere/ -type f -exec grep -nw 'textPattern' {} \;
Steps:
- Use
find to search files,
- Execute
grep on all of them.
This gives you the power of find to find files.
- Use
-name Pattern if you want to grep only certain files:
find /path/to/somewhere/ -type f -name \*.cpp -exec grep -nw 'textPattern' {} \;
You can use different options of find to improve your file search.