Pawel Bala
Pawel Bala

Reputation: 93

Show diff between two files in specific format

here is the question: I have two files:

file1:

aaa
bbb
ccc
ddd

file2:

bbb
ddd

HOW TO USE DIFF TO GET THIS OUTPUT (only differences)

aaa
ccc

Upvotes: 0

Views: 127

Answers (1)

Guru
Guru

Reputation: 16974

If what you want is records unique to file1, then :

$ comm -23 <(sort file1) <(sort file2)
aaa
ccc

Upvotes: 1

Related Questions