[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Newbie question..



> How do I cut or removed the lines of a file starting from the EOF (end
> of the file) up to the 500th lines?

If I am understanding you want to remove all lines after the 500th line?

I would tend to use vi or pico and just highlight the unwanted text and
delete it.

> Will tr, cut or sed be used? can someone point me to some web pages where
> there are tutorials or books about tr,cut, sed or awk?

Otherwise assuming it was a text file I would most likely just do:

head -500 testfilename >> newfilename.txt

That will take the first 500 lines of testfilename and 'copy' them into a
file called newfilename.txt

Hope this helps,

Adam.

------------------------ Internet Alaska -------------------------
 4050 Lake Otis		    Adam Shand        (v) +1 907 562 4638
 Anchorage, Alaska    Systems Administrator   (f) +1 907 562 1677
----------------- http://larry.earthlight.co.nz ------------------



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: