!seen[$0]++
It's not a one-liner, but here's intersection:
! buf[$0]++ { acc[$0]++ } ENDFILE { delete buf; files++ } END { for (k in acc) if (acc[k] == files) print k }
! filenum { acc[$0] = 1 } filenum { delete acc[$0] } ENDFILE { filenum++ } END { for (k in acc) print k }
It's not a one-liner, but here's intersection:
and here's set difference: I keep these in my ~/bin with evocative names (e.g., 'union' and 'set-diff'). Once I did that, lots of other things became one liners.