Robert C. Holland
Robert C. Holland

Reputation: 1813

How to select rest of a file excluding some lines in linux?

I need something that does the opposite of the answer(sed -n '200,700p' logfilename > destinationFilename) from a similar question (Selecting a part of a file and copying that into new file in Linux). I need to exclude some lines such as from 200 to 700 and output the rest of the file so I can copy it to another file. How may I do this?

Upvotes: 0

Views: 109

Answers (1)

user1427026
user1427026

Reputation: 879

You'd use sed '200,700d' logfilename > destinationFilename

Reference : https://unix.stackexchange.com/questions/11204/how-do-i-remove-certain-lines-using-line-numbers-in-a-file

Upvotes: 1

Related Questions