Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-15-2006, 02:24 AM   #1
Registered: Aug 2005
Posts: 40

Rep: Reputation: 15
Delete the first row from a text file


I need help on this following issue: i have a big 2 GB flat text file and i want to remove only its first line.
How can i do that ??

Thanks in advance!
Old 08-15-2006, 02:31 AM   #2
Senior Member
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
sed -n '2,$p' filename > newfile

which says "print from line 2 'til the end of file 'filename' and write to file "newfile'"

Last edited by BrianK; 08-15-2006 at 02:47 AM.
Old 08-15-2006, 02:57 AM   #3
Registered: Aug 2005
Posts: 40

Original Poster
Rep: Reputation: 15
thanks a lot, Bryan



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
delete chunks or regions from text file - help K3vin Linux - Software 3 09-26-2005 02:57 AM
Delete line from flat text file in C zaichik Programming 6 01-26-2005 06:16 PM
C++ read csv file row into vector taban1 Programming 3 11-08-2004 02:01 PM
How to delete a line from a text file with shell script programming Bassam General 1 01-28-2004 08:51 PM
How do I select a row of info in a database file? 1rulesall Linux - Newbie 6 12-08-2003 08:27 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration