[NTLUG:Discuss] searching text in all files for match
Fred James
fredjame at concentric.net
Wed Jun 5 11:11:28 CDT 2002
A good thought, and I have found "-r" as an option to grep on Linux, but
not on the *NIX I need to run the search on. Would that Linux was all I
had to deal with.
Rick Moncello wrote:
> OK, let me through in my $0.02 and add a fourth way. . .
>
> grep -r -I "text" /
>
> Rick.
>
> -----Original Message-----
> From: discuss-admin at ntlug.org [mailto:discuss-admin at ntlug.org]On Behalf
> Of Fred James
> Sent: Wednesday, June 05, 2002 10:47 AM
> To: discuss at ntlug.org
> Subject: Re: [NTLUG:Discuss] searching text in all files for match
>
>
> That makes 3 lovely ways to do it - Thanks all!
>
> Recap:
> find . -type f | xargs file | grep -i text | cut -f1 -d: | xargs grep
> "search for this"
>
> find / -type f -print -exec fgrep "text to find" {} \;
>
>
> find . -exec grep -l 'text to search for' {} \;
>
>
>
> Alton R. Pouncey, II wrote:
>
>
>>On Wed, 2002-06-05 at 09:42, Fred James wrote:
>>
>>
>>>My brain is stuck - trying to remember how to search all text files on
>>>the machine for matches to a text string. Any nudges?
>>>
>>>--
>>>"Wisdom begins in wonder." - Socrates
>>>
>>>
>>>_______________________________________________
>>>http://www.ntlug.org/mailman/listinfo/discuss
>>>
>>>
>>>
>>find . -exec grep -l 'text to search for' {} \;
>>
>>
>>
>
>
--
"Wisdom begins in wonder." - Socrates
More information about the Discuss
mailing list