[SLUG] Pah, that Allsopp

John Allsopp john at johnallsopp.co.uk
Wed Nov 14 07:57:19 GMT 2007


 > John Allsopp wrote:
 >> Why doesn't
 >> grep -ir "models" *php*
 >>
 >> find matches in subdirectories on my machine

Ross Kendall wrote:
> I would use find and grep together to do what you want:
> find ./ -name *php* -type f -exec grep -i "models" '{}' \;

Thanks Ross. I had to quote '*php*' to get it to work, but I couldn't 
get -type f to work (it worked OK without).

Anyone any idea why?

I got
Find: paths must precede expression

which is the error I got from not quoting *php*

I tried putting -name -type f
I was testing find ./ -name '*php*' -type f

Also, what does that / in ./ give us? It worked with ., so I just 
wondered why it was there.

Cheers
J




More information about the Scarborough mailing list