5 ms·
Checking It Twice
- rstuart4133 5y agoOr just: vim -d file1 file2 :%!sort | uniq -c :wincmd l :%!sort | uniq -c
- teddyh 5y agoEmacs: emacs file1 file2 C-x h C-u M-| s o r t | u n i q SPC - c RET C-x 4 b RET C-x h C-u M-| M-p RET Or did I misunderstand what those Vim commands were supposed to do? They did not seem to work on my version of Vim.
- herne 5y agoI ended up with this in my .bashrc so I didn't have to keep remembering how to use comm each time: justA() { comm -23 <(sort -u "$1") <(sort -u "$2"); } justB() { comm -13 <(sort -u "$1") <(sort -u "$2"); } bothAB() { comm -12 <(sort -u "$1") <(sort -u "$2"); }
- seiferteric 5y agoCool, can't believe I didn't know about comm command. I usually like to use sets() for this type of thing with python or ruby it is easy.