title: Fastest way to tell if two files have the same contents in Unix/Linux?
body: <p>I have a shell script in which I need to check whether two files contain the same data or not. I do this a for a lot of files, and in my script the <code>diff</code> command seems to be the performance bottleneck.</p>
  <p>Here's the line:</p>
  <pre><code>diff -q $dst $new &gt; /dev/null
  
  if ($status) then ...
  </code></pre>
  <p>Could there be a faster way to compare the files, maybe a custom algorithm instead of the default <code>diff</code>?</p>