Re: files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cameron Simpson wrote:
On 27Nov2006 16:39, Kevin Kempter <kevin@xxxxxxxxxxxxxxxxxxx> 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!


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux