Re: Not firewall, but what?

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



On 05/13/2010 12:47 PM, m.roth@xxxxxxxxx wrote:
> Gordon wrote:
>> Find it harder:
>> find /etc/ -type f -print0 | xargs -0 grep "ip rule"
>
> Or, since modern find's default to -print,

Yes, they do, but I have no idea what that has to do with your 
suggestion to use -exec.  If you had suggested eliminating the use of 
-print as redundant, your suggestion would be merely inefficient rather 
than a non sequitur.

> you could do
> find /etc -type f -exec grep -l "ip rule" {} \;

You could, but that would run "grep" once for each file where xargs will 
run grep the minimum number of times.  Using xargs is substantially faster.

Having said that, I see that find has an option of which I was 
previously unaware.  If you use the '+' character instead of the ';', it 
will behave more or less the same way that xargs does:

find /etc/ -type f -exec grep "ip rule" {} +

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux