Solved A complicated "find"

If you need to find a substring (e.g. a function header) in every file of a certain type no matter where in a nest of subtrees it might be, AND you want the date and size of the file, this will do it for you:

find [I]root-of-search[/I] -name '[I]distinctive-part-of-filename-with-*and?-wildcards-if-needed[/I]' -ls -exec grep '[I]target-substring[/I]' {} \;

The order of -name and -ls is significant.

(There's a thread in which nearly all of this syntax -- I only added the -ls -- was provided by Sir Dice (I think), and if I could find it again I'd thank for it because it was, as always, very helpful.)
 
Back
Top