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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-15-2008
jim mcnamara jim mcnamara is offline
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,849
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 06:07 AM.
Reply With Quote