removing lines between two patterns (not inclusive) with sed

后端 未结 6 474
遇见更好的自我
遇见更好的自我 2020-12-09 20:08

Ok

I know that this is trivial question but: How can i remove lines from files that are between two known patterns/words:

pattern1
garba

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 20:40

    This sed code will work as well:

    sed '/PATTERN1/,/PATTERN2/d' FILE
    

提交回复
热议问题