To find all files in the src
folder that have the text myFunction
:
$ find src -type f -exec grep 'myFunction' {} -l \;
Note: -l
is a grep option to print only name of files containing matching lines.
To find all paths that contain the string "foo":
$ find . -type d -iname foo\*
iname
- case insensitive search
name
- case sensitive search