[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding file with specific Text string



On Fri, 2003-04-04 at 07:41, Doug Wyman wrote:
> Finding file with specific Text string
> 
> I am using Red Hat 7.3 and have not figured out the command line that 
> will give me the output that I'm looking for.  I would like to get 
> the document names where a specific text string exist.  
> 
> The files are Microsoft Word documents on a CD.  They are daily and 
> shift log files.  I need to find which documents has the specific 
> text string “LSTMIS1” in it.  The documents are arranged in 
> directorys by year, then by month under that. Each shift makes a file 
> everyday. 

find <dir> -type f -print | xargs fgrep -l '&#8220;LSTMIS1&#8221;'

That should do it.  If, by some weird chance, there are non-Word files
in that directory that match, tack "| fgrep .doc" to the end of that
command line.
-- 
Jeff Licquia <jeff@licquia.org>

-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.