3 ms·
you can use comm as well # common lines comm -12 <(sort file1) <(sort file2) # lines unique to first file comm -23 <(sort file1) <(sort file2
by asicsp 7y ago
you 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