file check

Peter Corlett abuse at
Tue Jul 15 12:01:44 BST 2008

On Tue, Jul 15, 2008 at 11:38:24AM +0100, Nigel Rantor wrote:
> Christopher Jones wrote:
>> What's the quickest/easiest way to check that two large (~5Gb) files 
>> are identical?
> Check to see if the indoe's are the same.


You do also get to hope that (st_dev, st_ino) is unique, which is not at all
guaranteed once NFS joins the party.

> Otherwise use cmp, as others have said using a hash is slower than cmp,
> and doesn't tell you if they're the same, only if they're different.

Hashing will however work out quicker for the more typical problem of having
a bunch of files and wanting to know if there are any duplicates.

More information about the mailing list