remove top line in a file

September 9, 2010 at 06:52:51
Specs: Windows XP

I have a file that contains about 100 million lines of text, and I want to remove the first line of text, but without creating another file. Is there a fast way to remove the first line without writing to a new file as in this solution?

sed '1d' huge_file.txt > another_huge_file.txt


See More: remove top line in a file

Report •


#1
September 9, 2010 at 08:50:34

The newer GNU version of sed supports the -i, edit files in place, option so you could do something like this:

# untested
sed -i '1d' huge_file.txt

Other newer scripting languages such as Perl also support the -i option.


Report •
Related Solutions


Ask Question