3 ms·
The link doesn't load for me, but that seems pretty unreadable. I'd probably sort, merge, and print duplicates: sort -m <(sort -u file1) <(sort -u file2) |
by mkl 7y ago
The link doesn't load for me, but that seems pretty unreadable. I'd probably sort, merge, and print duplicates:
sort -m <(sort -u file1) <(sort -u file2) | uniq -d
- asicsp 7y agoyou can use comm as well # common lines comm -12 <(sort file1) <(sort file2) # lines unique to first file comm -23 <(sort file1) <(sort file2) # lines unique to second file comm -13 <(sort file1) <(sort file2) regarding readability, it is the same with any new tool or programming language, you'd need to be familiar with its syntax and idioms, someone not familiar with command line and sort/uniq commands will find your solution as alien as well