Suraj Bhatia
Suraj Bhatia

Reputation: 1323

how to print every second line using sed after a specific line

I have a big text file URL.txt. I want to print every second line on the terminal (without altering the content of the file) after line number 40 using sed command.

Upvotes: 0

Views: 1546

Answers (1)

Lars Fischer
Lars Fischer

Reputation: 10149

With GNU sed you can do

sed -n '40~2 p' file

Upvotes: 2

Related Questions