home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!pacbell.com!network.ucsd.edu!ucsbcsl!ucsbuxa!6500mack
- From: 6500mack@ucsbuxa.ucsb.edu (Michael P. Mack)
- Newsgroups: comp.unix.programmer
- Subject: Re: Better way to find out the number of lines in a file
- Message-ID: <5412@ucsbcsl.ucsb.edu>
- Date: 30 Jul 92 19:59:50 GMT
- References: <1992Jul27.195754.26812@tin.monsanto.com> <1992Jul27.203700.5953@news.eng.convex.com>
- Sender: root@ucsbcsl.ucsb.edu
- Lines: 24
-
- In article <1992Jul27.203700.5953@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
-
- >From the keyboard of bcschu@skws02.monsanto.com (Brett Schultz):
- >:This is kind of similar to the how many files in a directory question, but
- >:is there a trick to find the number of lines in a file?
- >:
- >:The files are big so I don't really want to do a gets loop with a counter
- >:unless I have to.
-
- >Well, SOMEBODY has to do it!
-
- >--tom
- >--
- > Tom Christiansen tchrist@convex.com convex!tchrist
-
- 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.
-
- This command can also be used to count the number of files in a
- directory using the pipe: ls | wc
-
-
- Mike Mack
- 6500mack@ucsbuxa.ucsb.edu
-