A
A
Andrey2014-11-10 20:26:12
linux
Andrey, 2014-11-10 20:26:12

Linux: how to get the difference between two lists?

There are two files with lists of hosts (IP Addr key field). How can you get the difference difference between these lists without using databases or programming languages ​​(ie purely BASH)?
Using join and paste has not succeeded so far.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
3
3vi1_0n3, 2014-11-11
@whitehunter

diff -y ./ip.dat ./ip2.dat --suppress-common-lines
or simply
diff ./ip.dat ./ip2.dat --suppress-common-lines

P
Power, 2014-11-10
@Power

First sort (if they are unordered) is the sort command, then difference is the diff command.

S
Sergey Petrikov, 2014-11-10
@RicoX

sort, diff, uniq, awk - depending on what kind of files and in what form the data is.

I
Ingtar, 2014-11-10
@Ingtar

There is another com

A
alternativshik, 2014-11-10
@alternativshik

diff+grep+wc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question