On Fri, Sep 17, 2010 at 11:07:53PM -0600, Bob Proulx wrote:
> Albretch Mueller wrote:
> But newer POSIX standard find can use a {} + to launch grep once and
> to pass as many files on the command line as the system allows. That
> is faster since grep is launched only as many times as needed.
> Us
Albretch Mueller wrote:
> $ find -name '*.extension' -exec grep -H 'pattern' {} \;
Using {} \; is the old way. That invokes grep once per file. That
works but is slower and less efficient than it could be because it
takes a little bit of time to launch grep.
But newer POSIX standard find can us
On Fri, 17 Sep 2010 14:08:18 -0400 (EDT), Albretch Mueller wrote:
>
> I need to:
>~ search for files using a pattern (say all files with a certain extension)
>~ then search inside each of the found files for a word or regexp pattern
>~ You could do this using find, cat and grep in a s
On Fri, Sep 17, 2010 at 06:32:06PM +, Albretch Mueller wrote:
> > if you need certain extension, you don't even need cat and find, it's all
> > about grep:
>
> > $ grep 'string' *.extension
> ~
> The thing is that I need to know in which file the pattern was found
> and as you guys suggested
Albretch Mueller wrote:
> I need to:
> ~
> search for files using a pattern (say all files with a certain extension)
> ~
> then search inside each of the found files for a word or regexp pattern
> ~
> You could do this using find, cat and grep in a script, but I was
> wondering about how cou
> if you need certain extension, you don't even need cat and find, it's all
> about grep:
> $ grep 'string' *.extension
~
The thing is that I need to know in which file the pattern was found
and as you guys suggested:
~
$ find -name '*.extension' -exec grep -H 'pattern' {} \;
~
does it
~
Thank
On Fri, 17 Sep 2010 18:08:18 +, Albretch Mueller wrote:
> I need to:
> ~
> search for files using a pattern (say all files with a certain
> extension)
> ~
> then search inside each of the found files for a word or regexp pattern
> ~
> You could do this using find, cat and grep in a script,
On Fri, Sep 17, 2010 at 06:08:18PM +, Albretch Mueller wrote:
> I need to:
> ~
> search for files using a pattern (say all files with a certain extension)
Is this part so complicated that bash can't handle it? I mean, if you need
certain extension, you don't even need cat and find, it's all a
Hi Albrecht,
On Fri, Sep 17, 2010 at 06:08:18PM +, Albretch Mueller wrote:
> search for files using a pattern (say all files with a certain extension)
> then search inside each of the found files for a word or regexp pattern
> You could do this using find, cat and grep in a script, but I was
9 matches
Mail list logo