Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove first, and last lines of a file 1

Status
Not open for further replies.

bgarlock

MIS
Jan 23, 2002
173
US
What is the easiest way to remove the first, and last lines of a file, regardless of size?

Bruce Garlock
bruceg@tiac.net
 
Bruce:

I'm just learning sed myself, but it seems like a good tool for what you want:

delete first line:

sed '1d' file

delete last line:

sed '$d' file

Regards,


Ed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top