Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个文件:
input.txt:
input.txt
Hi 1-12T2EDD 1-13D62L6Hello 1-15SDWAKWazzup Wow1-18Z3QWY
filter.txt:
filter.txt
1-15SDWAK 1-1VF3XHV
我想从filter.txtin 中删除具有匹配模式的行input.txt。在 SQL 理解中,我想input.txt用filter.txt.
output.txt:
output.txt
Hi1-12T2EDD 1-13D62L6Hello Wow1-18Z3QWY
一个简单的grep会这样做:
grep
$ grep -Fvf filter input Hi 1-12T2EDD 1-13D62L6Hello Wow1-18Z3QWY
选项:
-F
-v
-f