[clue-tech] recursive grep

ErikZ erik.zolan at gmail.com
Mon Oct 18 15:05:13 MDT 2010


Is there a way to pre-filter out all the binary files? Before grep gets to them?

On Mon, Oct 18, 2010 at 2:35 PM, David L. Willson <DLWillson at thegeek.nu> wrote:
> It wouldn't be much of a race. 'grep' without 'find' never finishes. I think it's following upward symlinks.
>
> David L. Willson
> Trainer, Engineer, Enthusiast
> MCT MSCE Network+ A+ Linux+ LPIC-1 NovellCLA UbuntuCP
> tel://720.333.LANS
>
> ----- "Greg Knaddison" <Greg at GrowingVentureSolutions.com> wrote:
>
>> I believe that adding find into the mix can make the process slower
>> than grep, unless you are using find to exclude some files.
>>
>> It would be interesting to benchmark them.
>>
>> Greg
>>
>> --
>> Greg Knaddison | 720-310-5623 | http://growingventuresolutions.com
>> Mastering Drupal | http://www.masteringdrupal.com
>>
>>
>>
>>
>> On Mon, Oct 18, 2010 at 2:22 PM, Clayton Fast
>> <cfast at compassbilling.com> wrote:
>> > find . -exec grep -l text-i-want-find {} \;
>> >
>> >
>> > ________________________________________________________________
>> > Clayton Fast, CHBME
>> > President
>> > Compass Billing Service Corporation
>> > 7800 E Orchard Road, Suite 190
>> > Greenwood Village, CO 80111
>> >
>> > (303) 713-1300
>> > www.compassbilling.com
>> >
>> > ______________________________________________________________
>> > This e-mail, including attachments, is intended for the exclusive
>> use of
>> > the person or entity to which it is addressed and may contain
>> confidential
>> > or privileged information. If the reader of this e-mail is not the
>> intended
>> > recipient or his or her authorized agent, the reader is hereby
>> notified
>> > that any dissemination, distribution or copying of this e-mail is
>> > prohibited.
>> > If you think that you have received this e-mail in error, please
>> advise the
>> > sender by reply e-mail of the error and then delete this e-mail
>> > immediately.
>> > Thank you.
>> >
>> >
>> > ________________________________
>> > From: clue-tech-bounces at cluedenver.org
>> > [mailto:clue-tech-bounces at cluedenver.org] On Behalf Of David L.
>> Willson
>> > Sent: Monday, October 18, 2010 2:19 PM
>> > To: clue-tech
>> > Subject: [clue-tech] recursive grep
>> >
>> > Does anyone have a good idea for "find absolutely every file in
>> haystack/,
>> > that mentions needle"?
>> >
>> > "grep -R needle /etc/*" and "grep -R needle /var/*"seem to run
>> forever.
>> >
>> > I think it's a "find /etc -xtype f -exec grep ... something, but I
>> can't
>> > think of the right something.
>> >
>> > David L. Willson
>> > Trainer, Engineer, Enthusiast
>> > MCT MSCE Network+ A+ Linux+ LPIC-1 NovellCLA UbuntuCP
>> > tel://720.333.LANS
>> >
>> > --
>> > This message has been scanned for viruses and
>> > dangerous content by MailScanner, and is
>> > believed to be clean.
>> > --
>> > This message has been scanned for viruses and
>> > dangerous content by MailScanner, and is
>> > believed to be clean.
>> > _______________________________________________
>> > clue-tech mailing list
>> > clue-tech at cluedenver.org
>> > http://cluedenver.org/mailman/listinfo/clue-tech
>> >
>> _______________________________________________
>> clue-tech mailing list
>> clue-tech at cluedenver.org
>> http://cluedenver.org/mailman/listinfo/clue-tech
> _______________________________________________
> clue-tech mailing list
> clue-tech at cluedenver.org
> http://cluedenver.org/mailman/listinfo/clue-tech
>


More information about the clue-tech mailing list