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

Re: find in conjuction with grep



On Wed, Aug 11, 2004 at 02:31:04PM -0400, Kevin Old wrote:

> 
> I've been using
> find . -exec grep "phrase I want" {} \;
> for quite a while to search recursively through directories and files
> to find a phrase or word.
> 
> The results I get back are simply the line(s) that contained the
> phrase, but no path or filename.

Try:
   find . -exec grep "phrase I want" {} /dev/null \;

You need to look at two files for grep without special flags to give
you the file name.  Or you need to tell grep to print the file name.

Also Try:
   find . -exec grep -H "phrase I want" {}  \;


-- 
	T o m  M i t c h e l l 
	Just say no to 74LS73 in 2004



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