Using sed to match a pattern and deleting from the line to the end of the file

后端 未结 5 1297
感动是毒
感动是毒 2021-01-01 10:59

I\'m trying to match a pattern from piped input and/or a file, and then remove from the matched lines to the end of the file, inclusive. I\'ve looked everywhere, but can\'t

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-01 11:49

    Dirty utility knife grep version:

    cat your_output.txt | grep -B 99999999 "THIS STUFF IS USELESS" | grep -v "THIS STUFF IS USELESS"
    

提交回复
热议问题