delete first 100 lines from a file

I have a file with 28,00,000 lines of rows in this the first 80 lines will be chunks .

I want to delete the chunks of 80 lines. I tried tail -f2799920 filename.
is there any efficient way to do this.

Thanks in advance.

sed '1,100d' filename > newfile

sed would be faster than tail in my opinion

if -i option is available in sed ( GNU sed )

use it for in-place modification

sed -i '1,100d' filename

Yes. Its really faster than the tail command.

Thanks Yogesh

Sarathi

Hi,

I am trying to delete all lines in a file which starts with SG.

Command : sed -e "s/^SG/d/" bcpfile > test1.

But the above command just replaces 'SG' with 'd'. Please suggest the correct command to delete the whole line.

Thanks.
David.

sed -e "s/^SG//d"

Should be:

sed "/^SG/d" file

Regards

Thanks All. It worked.