How to delete from a text file, all lines that contain a specific string?

后端 未结 18 2147
生来不讨喜
生来不讨喜 2020-11-22 02:06

How would I use sed to delete all lines in a text file that contain a specific string?

18条回答
  •  借酒劲吻你
    2020-11-22 02:29

    SED:

    • '/James\|John/d'
    • -n '/James\|John/!p'

    AWK:

    • '!/James|John/'
    • /James|John/ {next;} {print}

    GREP:

    • -v 'James\|John'

提交回复
热议问题