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 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
Internet Hosting and Consulting
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