Deleting top n lines

sed ‘1,10d’ file – doesn’t print the top 10 lines from the file
sed ‘5d’ myfile – delete 5th line from the file
sed ‘5,$d’ myfile – Delete 5 till end of file lines from myfile

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.