Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: grep resistance
- To: tlug@example.com
- Subject: Re: grep resistance
- From: Tod McQuillin <devin@example.com>
- Date: Sat, 4 Nov 2000 11:03:25 -0600 (CST)
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- In-Reply-To: <Pine.LNX.4.10.10011050004250.813-100000@example.com>
- Reply-To: tlug@example.com
- Resent-From: tlug@example.com
- Resent-Message-ID: <iZyDpC.A.EWD.hVEB6@example.com>
- Resent-Sender: tlug-request@example.com
On Sun, 5 Nov 2000, Tony Laszlo wrote: > Thanks, Jonathan! > The following formula did the trick. > > find . -type f -exec grep -n -C -H STRING '{}' ';' | less I wasn't aware of grep's -H flag -- I assume that is only for GNU grep (which I guess every linux distro has). Nice. If you just want the equivalent of 'grep STRING *' though, this will work and it will be faster since you don't exec a new grep for every file: ls | xargs grep -n -C STRING Similarly with find: find . -type f -print0 | xargs -0 grep -n -C STRING But, GNU grep also has recursion built in, which presumably would be faster even than 'find | xargs grep': grep -r -n -C STRING . -- Tod McQuillin
- Follow-Ups:
- Re: grep resistance
- From: Viktor Pavlenko <vp@example.com>
- References:
- Re: grep resistance
- From: Tony Laszlo <laszlo@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: grep resistance
- Next by Date: Re: grep resistance
- Prev by thread: Re: grep resistance
- Next by thread: Re: grep resistance
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links