Get lines of file1 which are not in file2

前端 未结 2 1160
梦毁少年i
梦毁少年i 2020-12-19 02:20

I have two long, but sorted files. How to get all lines of first file which are not in second file ?

file1

0000_aaa_b
0001_bccc_b
0002_bcc &         


        
2条回答
  •  天命终不由人
    2020-12-19 02:41

    Just run a diff on them:

    diff -c file1 file2
    

    The -c (for "context") flag will only display the lines that are different, with two lines surrounding each line.

提交回复
热议问题