Re: Reading a particular line in a file

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: JD Austin
Date:  
To: plug-discuss
Subject: Re: Reading a particular line in a file
Quoting Michael Havens <>:

>
>
> grep [options] PATTERN [FILE...]
> --
> <:-)Mike(-:>


That will give you every line that matches the pattern in the file.
Though if there is only one line with the pattern then it it would get a
particular line.

JD
> > Quoting Ben Coffman <>:
> > > Is there a command line argument that lets you grab a particular line
> > > from from a text file in Linux or Unix?
> > >
> > > Thanks,
> > >
> > > Ben
> >
> > You can use head/tail to do that.
> > Say you want line 4:
> > head --lines=4 filename | tail --lines=1
> >
> > JD
>



--
JD Austin
Twin Geckos Technology Services LLC
email:
http://www.twingeckos.com
phone/fax: 480.344.2640





---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss