Common set operations using shell:
http://www.catonmat.net/blog/set-operations-in-unix-shell/
Set intersection:
————————
comm -12 <(sort set1) <(sort set2)
grep -xF -f set1 set2
sort set1 set2 | uniq -d (-d prints only duplicates)
join <(sort -n A) <(sort -n B)
Advertisement