The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: Recursive grep
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-16-2008
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,773
Code:
find /path/to/search/in -type f | \
while read filename
do
       grep -f /path/to/strings.txt $filename
done  > /home/upstate_boy/results.txt
grep -f <file> means to use the strings in <file> as search strings for grep.
The done > filename part writes the output of the loop to filename

Last edited by jim mcnamara; 05-16-2008 at 10:07 AM..