Re: find in conjuction with grep

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

 



Am Mi, den 11.08.2004 schrieb Aaron Gaudio um 21:23:

> > >> I've been using
> > >> find . -exec grep "phrase I want" {} \;
> > >
> > > Not the best way. Using -exec is problematic.
> > 
> > why problematic? 
> 
> I think the main complaint is that it is slower, having to exec a new
> grep process for each file find encounters, versus piping to xargs
> (which will be faster overall, but provide less running feedback).

It is not only and mainly problematic because of speed, but because of
using resources and in worst case causing the system to be unresponsive.
This is as you correctly said, because for each find match it starts a
new child process. Do you always know how much matches are to be
expected by the find command? At worst it is as effective as a classic
fork bomb.

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG key 1024D/ED695653 1999-07-13
Fedora GNU/Linux Core 2 (Tettnang) kernel 2.6.7-1.494.2.2smp 
Serendipity 21:46:33 up 7 days, 15:14, load average: 3.45, 2.66, 2.32 

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


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

  Powered by Linux