home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!krisk
- From: krisk@ux1.cso.uiuc.edu (Kris Klindworth)
- Subject: Re: How do I get a particualr line of a file?
- Message-ID: <By6wFz.3no@ux1.cso.uiuc.edu>
- Organization: University of Illinois at Urbana
- References: <pec2.722467852@Isis.MsState.Edu> <1992Nov23.094227.1677@ericsson.se> <1992Nov23.155235.6561@gw.wmich.edu>
- Date: Mon, 23 Nov 1992 22:14:08 GMT
- Lines: 24
-
- pec2@ra.msstate.edu (Paul E. Carroll) writes:
- > This seems extremely simple, but I've run into the problem several times
- > and gotten stumped each time. So how do I view a particualr line of a
- > file? Head looks at the top, tail the end, cat - echo - more - or less-
- > look at the whole thing... but what if I want to see just line 30?
- > or JUST line 210? I'm stumped.
-
-
- Sounds like a job of sed:
-
- ux1> sed -n '210p' filename
-
- You can also look at a range of lines in the middle of the file
- like this:
-
- ux1> sed -n '210,215p' filename
-
-
-
- ------------------------------------------------------------------------------
- Kris Klindworth Internet: krisk@ux1.cso.uiuc.edu
- Database Programmer Phone : (217)244-7120
- Illinois State Water Survey US Mail : 2204 Griffith Dr
- Champaign, IL 61820
-