Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Answer by asoundmove for How to remove multiple lines per occurrence in a file?

Try:

sed -e '/^a1$/,+1d' "filename"

This means from /^a1$/ to the next line, delete

The ^ and $ ensure you match the whole line, so a hidden a1 will not be matched.


Viewing latest article 2
Browse Latest Browse All 3

Trending Articles