ファイル比較と重複排除[閉じる]

ファイル比較と重複排除[閉じる]

test1とtest2という2つのファイルがあります。これらのファイルを比較し、test1にすでに存在する項目をtest2から削除したいと思います。

例:

テスト1

[ostrich@post-om1 test]$ cat test1|head
917010023586,UPE,RED 399
917023895388,UPE,RED 499
917023895389,UPE,RED 699
917024120800,UPE,RED 399
917024214387,UPE,RED 399
917027011096,UPE,RED 399
917027120457,UPE,RED 399
917027749420,UPE,RED 399
917030002266,UPE,RED 399
919389105220,UPE,RED 399

テスト2

[ostrich@post-om1 test]$ cat test2|head
917310106487
919839063308
917081106519
919389105220
919336429543
917081102867
919919804079
919936432138
919455329240
919839601519

希望の出力

[ostrich@post-om1 test]$ cat test1
917010023586,UPE,RED 399
917023895388,UPE,RED 499
917023895389,UPE,RED 699
917024120800,UPE,RED 399
917024214387,UPE,RED 399
917027011096,UPE,RED 399
917027120457,UPE,RED 399
917027749420,UPE,RED 399
917030002266,UPE,RED 399

ベストアンサー1

もっと9文字が必要です...

grep -vFf test2 test1

おすすめ記事