How could I compare two files and remove similar rows in them (bash script)

前端 未结 3 1561
陌清茗
陌清茗 2021-01-28 05:21

I have two files of data with similar number of columns. I\'d like to save file2 in another file (file3) while I exclude the rows which are existed already in the file1.

<
3条回答
  •  梦如初夏
    2021-01-28 06:09

    Try:

    grep -Fxvf file1 file2
    

    Switch meanings available from the grep man page.

提交回复
热议问题