Wednesday, May 13, 2009

A fun shell idiom.

To find what's in filea that isn't in fileb, I have always done

cat filea fileb fileb | sort | uniq -u
similar things give you union, intersection, symetric difference etc. Recently I shortened it to
cat filea fileb{,} | sort | uniq -u
which I thought was good fun.

Post a Comment