how to show lines in common (reverse diff)?

前端 未结 7 1001
花落未央
花落未央 2020-11-27 10:35

I have a series of text files for which I\'d like to know the lines in common rather than the lines which are different between them. Command line unix or windows is fine.

7条回答
  •  粉色の甜心
    2020-11-27 10:56

    Was asked here before: Unix command to find lines common in two files

    You could also try with perl (credit goes here)

    perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/'  file1 file2
    

提交回复
热议问题