home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13865 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.2 KB

  1. Path: sparky!uunet!gumby!wmichgw!873clifton
  2. From: 873clifton@gw.wmich.edu
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: How do I get a particualr line of a file?
  5. Message-ID: <1992Nov23.155235.6561@gw.wmich.edu>
  6. Date: 23 Nov 92 15:52:35 EST
  7. References: <pec2.722467852@Isis.MsState.Edu> <1992Nov23.094227.1677@ericsson.se>
  8. Organization: Western Michigan University
  9. Lines: 24
  10.  
  11. In article <1992Nov23.094227.1677@ericsson.se>, etxmesa@eos.ericsson.se (Michael Salmon) writes:
  12. > In article <pec2.722467852@Isis.MsState.Edu>, 
  13. > pec2@ra.msstate.edu (Paul E. Carroll) writes:
  14. > |> This seems extremely simple, but I've run into the problem several times
  15. > |> and gotten stumped each time.  So how do I view a particualr line of a 
  16. > |> file?  Head looks at the top, tail the end, cat - echo - more - or less-
  17. > |> look at the whole thing... but what if I want to see just line 30?
  18. > |> or JUST line 210?  I'm stumped.
  19. > This works for me:
  20. >  eos6c02 tmp 98 > cat -n /usr/etc/termcap | tail +210l | head -1
  21. >    210          :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  22. > The cat -n is just to insert line numbers of course.
  23.  
  24. A slightly more efficient way would be:
  25.  
  26.         > nl -nln | grep '^201'
  27.  
  28. /D
  29. --
  30. Douglas Clifton [99clifto@lab.cc.wmich.edu]
  31.