files

Mike McCarty Mike.McCarty at sbcglobal.net
Tue Nov 28 02:38:44 UTC 2006


Cameron Simpson wrote:
> On 27Nov2006 16:39, Kevin Kempter <kevin at kevinkempterllc.com> wrote:
> | On Monday 27 November 2006 15:54, Steve Searle wrote:

[snip]

> | find . -exec -l "My String" \;
> | -- will find all files with the string 'My String' (doesn't match the quotes) 
> | starting at the current dir (.) and below
> | 
> | The -l for grep says only print the filename
> 
> "grep -rl" will do the same thing, and _much_ faster because it does not
> need to fork/exec a new "group" command for every file. The performance
> difference is quite significant.

But also quite a bit less flexible. Using find one can look for "large"
or "small" files, or files modified recently, etc. To get some of the
best of both worlds, use xargs...

$ find . -name <stuff here> <other options> | xargs grep -l "My String"

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!




More information about the fedora-list mailing list