Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete every seventh line using sed

Tags:

sed

I need a sed script that deletes every seventh line in a file. I managed to do this with an awk script but wanted to look for a way to use sed to do this.

like image 414
user294280 Avatar asked Dec 30 '25 02:12

user294280


1 Answers

You can try

sed 'n;n;n;n;n;n;d;' 
like image 120
Sai Avatar answered Jan 01 '26 15:01

Sai