home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!tlg
- From: tlg@uknet.ac.uk (Tim.Goodwin)
- Newsgroups: comp.unix.programmer
- Subject: Re: Better way to find out the number of lines in a file
- Message-ID: <1254@uknet.ac.uk>
- Date: 31 Jul 92 12:08:06 GMT
- References: <1992Jul27.195754.26812@tin.monsanto.com> <1992Jul27.203700.5953@news.eng.convex.com> <5412@ucsbcsl.ucsb.edu>
- Organization: UKnet
- Lines: 19
-
- In article <5412@ucsbcsl.ucsb.edu> 6500mack@ucsbuxa.ucsb.edu (Michael P. Mack) writes:
- >Somebody has done it. On our system (HPUX 8.0) we have a command
- >called 'wc' which counts the lines, words, and characters in a file.
-
- If you're only interested in the number of lines,
-
- grep -c '^'
-
- is, on my system at least, much faster than
-
- wc -l
-
- (That's GNU grep, of course. It even seems to go faster than a naive
- mmap()ing line counter I have.)
-
- Tim.
- --
- The GNU is in fact the legendary and much-berated | ; who am i
- feeping creature - Malcolm Wallace. | uknet.ac.uk!tlg
-