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

Re: using find with grep



On Wed, May 05, 2004 at 06:52:46PM -0500, Rick Weinbender wrote:
> I have an expression that searches within files
> of a particular type and displays the output.
> But I would ALSO like it to display the directory
> for each find occurence.
> The command below works, but won't give me
> the directory.
> 
> find /home -name *.txt -exec grep searchstring {} \;

How about adding -H to the grep invocation?

-- 
Jon Dowland
http://jon.dowland.name/



Reply to: