P
P
Printip2015-09-10 14:22:57
linux
Printip, 2015-09-10 14:22:57

How to compare two text files in Linux?

There is a file a.txt with the content:
1
2
3
4
5
And there is a file b.txt with the content :
1
2
3 .txt = c.txt Lines left in c.txt: 4 5

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DevMan, 2015-09-10
@Printip

comm -3 a.txt b.txt > c.txt

S
Saboteur, 2015-09-10
@saboteur_kiev

comm -3 a.txt b.txt > c.txt
But files a.txt and b.txt must be sorted alphabetically

C
chupasaurus, 2015-09-10
@chupasaurus

cat a.txt b.txt | uniq-u

R
Ruslan Fedoseev, 2015-09-10
@martin74ua

diff?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question