Delete lines based on patterns in another file

前端 未结 1 1570
别那么骄傲
别那么骄傲 2020-12-11 21:12

I have two files:

input.txt:

Hi 1-12T2EDD
1-13D62L6Hello
1-15SDWAKWazzup
Wow1-18Z3QWY
         


        
相关标签:
1条回答
  • 2020-12-11 21:40

    A simple grep will do this:

    $ grep -Fvf filter input
    Hi 1-12T2EDD
    1-13D62L6Hello
    Wow1-18Z3QWY
    

    Options:

    • -F for fixed strings as we don't need regexp matching
    • -v for inverse matching
    • -f for specifing the file containing the strings to (inverse) match.
    0 讨论(0)
提交回复
热议问题