[NTLUG:Discuss] searching text in all files for match

Fred James fredjame at concentric.net
Wed Jun 5 10:46:43 CDT 2002


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