home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!haven.umd.edu!news.umbc.edu!math9.math.umbc.edu!rouben
- From: rouben@math9.math.umbc.edu (Rouben Rostamian)
- Subject: Re: How do I get a particualr line of a file?
- Message-ID: <1992Nov22.235943.13501@umbc3.umbc.edu>
- Sender: newspost@umbc3.umbc.edu (News posting account)
- Organization: University of Maryland Baltimore Campus
- References: <pec2.722467852@Isis.MsState.Edu>
- Date: Sun, 22 Nov 1992 23:59:43 GMT
- Lines: 15
-
- In article <pec2.722467852@Isis.MsState.Edu> 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.
-
- To print line 30:
- sed -n 30p filename
-
- To print lines 30 to 35:
- sed -n 30,35p filename
-
- --
- Rouben Rostamian
-