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!

eliminate lines 2

Status
Not open for further replies.

Yarka

Technical User
Jan 14, 2007
192
ES
Hi
How I can eliminate 2000 first lines of a file?
Thanks.
 
Hi

Code:
sed -i '1,2000d' /the/file
Needs GNU [tt]sed[/tt].

Or with any tool, using two files.
Code:
sed '1,2000d' /input/file > /output/file

[gray]# or[/gray]

awk 'NR>2000' /input/file > /output/file

[gray]# or[/gray]

tail +2001 /input/file > /output/file

Feherke.
 
Or you vi the file and then give the commands

:1,2000d[enter]
:wq[enter]


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top