I am always hunting for this, and so I’m going to put it here so I can remember!
This command is great: find . -exec grep -l hello {} \;
Essentially, it does this:
- find all files starting in the current directory (“.”)
- for each file found execute “grep -l hello”
- grep -l will print file names — with full relative path — that match the grep criteria
This is great, as a programmer, to try and figure out which file had a certain word (or phrase, or Regular Expression pattern) in it.
There are also a couple of other pages with a large set of references here and here.