Remove first ‘n’ lines from a text file

You can use the below command to remove the first 2 lines from a logfile :

sed -i ‘1,2d’ logtest.log

 

ps : Please don’t run this command in a log file having very large size

Change the command according to your requirement….

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s