Mike Christianson
Mike Christianson

Categories

Tags

At least once a week, I find myself wishing I could sort two files and compare them in one shot, from the commandline, without creating intermediate files. Today I’m glad to say I found my answer.

Here are two examples:

diff -y <(sort file1) <(sort file2)
comm -3 <(sort file1) <(sort file2)

See this wikipedia entry for a comparison of the diff and comm commands.