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

Re: GREP



On Fri, 2005-08-05 at 11:25 -0500, Ed Curtis wrote:
>  I need some help with grep. In fact I'm not really sure grep is what I
> should be using. I would list to find the number of files containing a
> string. Not the number of times the string appears in a single file.
> 
> Say I'm searching the /var/spool/mail dir and want to see how many times
> the string 'enlargement' occurs in that directory. What do I need to do?

grep -l enlargement /var/spool/mail/* | wc -l

see man grep and man wc for more info. also remember read permissions
and whether /var/spool/mail/* recurses into subdirs or not



Reply to: