Mailing List Archive


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

Re: [tlug] GREP basics



Quoth Matt Doughty (Thu 2003-01-30 11:58:48PM +0900):
>
> On Thu, Jan 30, 2003 at 11:45:46PM +0900, Charles Muller wrote:
>
> > I have a directory that contains 82 files. I want to get a count of the
> > number of occurrences of the word "<hdwd>" in all 82 files.
> > 
> > But if I do:
> > 
> > [chuck@example.com ddbxml]$ grep -c "<hdwd>" * 
> > 
> > I get a list of the 82 files, with the number of hits in each listed next to
> > them, but not the grand total.
> > 
> > If I do:
> > 
> > [chuck@example.com ddbxml]$ grep "<hdwd>" * 
> > 
> 
> grep "<hdwd>" * | wc -l

What if the word appears twice in one line? ;) Sorry, but this is such a
Computer Science assignment-like problem that I cannot being an arse.


-- 
Josh Glover <jmglov@example.com>

Associate Systems Administrator
INCOGEN, Inc.
http://www.incogen.com/

GPG keyID 0x62386967 (7479 1A7A 46E6 041D 67AE  2546 A867 DBB1 6238 6967)
gpg --keyserver pgp.mit.edu --recv-keys 62386967

Attachment: pgp00100.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links