home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 4024 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.2 KB

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!pacbell.com!network.ucsd.edu!ucsbcsl!ucsbuxa!6500mack
  2. From: 6500mack@ucsbuxa.ucsb.edu (Michael P. Mack)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: Better way to find out the number of lines in a file
  5. Message-ID: <5412@ucsbcsl.ucsb.edu>
  6. Date: 30 Jul 92 19:59:50 GMT
  7. References: <1992Jul27.195754.26812@tin.monsanto.com> <1992Jul27.203700.5953@news.eng.convex.com>
  8. Sender: root@ucsbcsl.ucsb.edu
  9. Lines: 24
  10.  
  11. In article <1992Jul27.203700.5953@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
  12.  
  13. >From the keyboard of bcschu@skws02.monsanto.com (Brett Schultz):
  14. >:This is kind of similar to the how many files in a directory question, but
  15. >:is there a trick to find the number of lines in a file?
  16. >:
  17. >:The files are big so I don't really want to do a gets loop with a counter
  18. >:unless I have to.
  19.  
  20. >Well, SOMEBODY has to do it!  
  21.  
  22. >--tom
  23. >-- 
  24. >    Tom Christiansen      tchrist@convex.com      convex!tchrist
  25.  
  26. Somebody has done it.  On our system (HPUX 8.0) we have a command
  27. called 'wc' which counts the lines, words, and characters in a file.
  28.  
  29. This command can also be used to count the number of files in a 
  30. directory using the pipe:    ls | wc
  31.  
  32.  
  33. Mike Mack
  34. 6500mack@ucsbuxa.ucsb.edu
  35.