How, after like 20 years goofing around on linux, have I never heard of `w` ?
* unique lines to file1
* unique lines to file2
* lines common to both files
You can pass it various options to suppress any of the three columns.I once had an interview at Facebook where one of the problems was easily solved by `comm`. I found it funny that the interviewer, or anyone who reviewed the interview question, had never heard of it. I was a good sport about it though, I ended up writing a janky Perl script that roughly implemented `comm` to solve the problem, which (modulo Perl) was what they wanted me to do.
If you specify that the files are way too big to fit in memory, well, that's a different story.
https://docs.oracle.com/cd/E19683-01/816-0211/6m6nc66m6/inde...
The Linux intro man pages are still pretty useless sadly.
I still do it instinctively on my own boxes.