The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
delete n last lines of a file ncatdesigner Shell Programming and Scripting 7 05-17-2008 07:07 AM
delete first 100 lines rather than zero out of file thepurple SUN Solaris 7 11-14-2007 09:35 AM
delete the lines from file sameersam Shell Programming and Scripting 2 04-03-2006 10:32 PM
Delete lines in a file umal Shell Programming and Scripting 6 02-08-2006 09:08 AM
delete all lines in file strok UNIX for Dummies Questions & Answers 6 03-11-2002 06:27 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-14-2007
salaathi's Avatar
Registered User
 

Join Date: Sep 2007
Location: Madurai
Posts: 20
Stumble this Post!
Question 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.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-14-2007
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 767
Stumble this Post!
Code:
sed '1,100d' filename > newfile
sed would be faster than tail in my opinion
Reply With Quote
  #3 (permalink)  
Old 11-14-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,573
Stumble this Post!
if -i option is available in sed ( GNU sed )

use it for in-place modification

Code:
sed -i '1,100d' filename
Reply With Quote
  #4 (permalink)  
Old 11-15-2007
salaathi's Avatar
Registered User
 

Join Date: Sep 2007
Location: Madurai
Posts: 20
Stumble this Post!
Thumbs up

Yes. Its really faster than the tail command.

Thanks Yogesh


Sarathi
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
sed, tail

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0