compare two files in UNIX

前端 未结 4 984
南笙
南笙 2020-12-13 10:21

I would like to compare two files [ unsorted ] file1 and file2. I would like to do file2 - file1 [ the difference ] irrespective of the line number? diff is not working.

4条回答
  •  春和景丽
    2020-12-13 11:04

    I got the solution by using comm

    comm -23 file1 file2 
    

    will give you the desired output.

    The files need to be sorted first anyway.

提交回复
热议问题