Introduce zz

Feb 27, 2018

Text file a.txt and b.txt:

$ cat a.txt
A
B
C
D
E
$ cat b.txt
C
D
E
F
G

To get the intersection and difference between a.txt and b.txt, I wrote a little tool called zz:

# Install zz
$ go get github.com/kaleocheng/zz
# Get the intersection
$ zz -i a.txt b.txt
C
D
E
# Get the difference
$ zz a.txt b.txt
A
F
G
B
# Get diff lines which only in a.txt
$ zz -only a.txt b.txt
A
B