Deleting lines inside a file without opening the file

Hi,

Just consider there are around 10 lines in a file. Now is it possible to delete the first 2 lines in the file without opening the file. No matter whatever the content of the file is, I just wanna delete the first 2 lines without opening the file. Is that possible? If so, please help me out.

Thanks,
Toms

you can try this ...

sed -n '1,2!p' filea > file2 ; mv file2 file1

sed -i '1,2d' file

Thanks!!! Both the options are working fine....

Toms