home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13806 < prev    next >
Encoding:
Text File  |  1992-11-22  |  989 b   |  27 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!haven.umd.edu!news.umbc.edu!math9.math.umbc.edu!rouben
  3. From: rouben@math9.math.umbc.edu (Rouben Rostamian)
  4. Subject: Re: How do I get a particualr line of a file?
  5. Message-ID: <1992Nov22.235943.13501@umbc3.umbc.edu>
  6. Sender: newspost@umbc3.umbc.edu (News posting account)
  7. Organization: University of Maryland Baltimore Campus
  8. References: <pec2.722467852@Isis.MsState.Edu>
  9. Date: Sun, 22 Nov 1992 23:59:43 GMT
  10. Lines: 15
  11.  
  12. In article <pec2.722467852@Isis.MsState.Edu> pec2@ra.msstate.edu (Paul E. Carroll) writes:
  13. >This seems extremely simple, but I've run into the problem several times
  14. >and gotten stumped each time.  So how do I view a particualr line of a 
  15. >file?  Head looks at the top, tail the end, cat - echo - more - or less-
  16. >look at the whole thing... but what if I want to see just line 30?
  17. >or JUST line 210?  I'm stumped.
  18.  
  19. To print line 30:
  20. sed -n 30p filename
  21.  
  22. To print lines 30 to 35:
  23. sed -n 30,35p filename
  24.  
  25. --
  26. Rouben Rostamian
  27.