On Sat, 28 Oct 2017 00:47:32 +0200 Leon Fauster wrote:> source: > > find . -type f -exec md5sum \{\} \; > checksum.list > > destination: > > md5sum -c checksum.listWouldn't diff be faster because it doesn't have to read to the end of every file and it isn't really calculating anything? Or am I looking at this in the wrong way. -- MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
> Am 28.10.2017 um 01:54 schrieb Frank Cox <theatre at sasktel.net>: > > On Sat, 28 Oct 2017 00:47:32 +0200 > Leon Fauster wrote: > >> source: >> >> find . -type f -exec md5sum \{\} \; > checksum.list >> >> destination: >> >> md5sum -c checksum.list > > Wouldn't diff be faster because it doesn't have to read to the end of every file and > it isn't really calculating anything? Or am I looking at this in the wrong way.Fast was not communicated as requirement, albeit md5 algo works by design "fast" and it was asked to "to compare file hashes". Nevertheless I also use diff to compare. It depends on your needs ... -- LF
On October 28, 2017 9:09:49 AM EDT, Leon Fauster <leonfauster at googlemail.com> wrote:> >> Am 28.10.2017 um 01:54 schrieb Frank Cox <theatre at sasktel.net>: >> >> On Sat, 28 Oct 2017 00:47:32 +0200 >> Leon Fauster wrote: >> >>> source: >>> >>> find . -type f -exec md5sum \{\} \; > checksum.list >>> >>> destination: >>> >>> md5sum -c checksum.list >> >> Wouldn't diff be faster because it doesn't have to read to the end of >every file and >> it isn't really calculating anything? Or am I looking at this in the >wrong way. > >Fast was not communicated as requirement, albeit md5 algo works by >design "fast" and >it was asked to "to compare file hashes". Nevertheless I also use diff >to compare. >It depends on your needs ... > >-- >LF > >_______________________________________________ >CentOS mailing list >CentOS at centos.org >https://lists.centos.org/mailman/listinfo/centosI did end up using diff which seemed to work well.
In article <20171027175431.e265479c4f9b4658fe2179bf at sasktel.net>, Frank Cox <theatre at sasktel.net> wrote:> On Sat, 28 Oct 2017 00:47:32 +0200 > Leon Fauster wrote: > > > source: > > > > find . -type f -exec md5sum \{\} \; > checksum.list > > > > destination: > > > > md5sum -c checksum.list > > Wouldn't diff be faster because it doesn't have to read to the end of every file and it isn't really calculating > anything? Or am I looking at this in the wrong way.If the files are the same (which is what the OP is hoping), then diff does indeed have to read to the end of both files to be certain of this. Only if they differ can it stop reading the files as soon as a difference between them is found. Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org