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.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

 
© 2011 And now here's something… Suffusion theme by Sayontan Sinha