[PLUG] Comparing files
Galen Seitz
galens at seitzassoc.com
Tue Nov 9 20:08:38 UTC 2010
Russell Senior wrote:
>>>>>> "Dan" == <Daniel.Roberts at sanofi-aventis.com> writes:
>
> Dan> Hello All I have copied thousands of files from one windows
> Dan> fileshare onto another windows fileshare. How can I easily
> Dan> verify that the file copy is correct? I intentionally changed
> Dan> the directory structure between the source and the destination.
> Dan> I am trying to use md5sum on recursively through every file in
> Dan> every directory between the two fileshares and then I would
> Dan> compare the sums in a small database.
>
> Dan> Question is: How do I get md5sums recursively through a directory
> Dan> structure for ever file using cygwin installed on my laptop?
> Dan> Thanks for any help! Dan
>
> Something like:
>
> cd /top/of/tree1
> find -type f | xargs md5sum | sort > /tmp/tree1.md5sums
> cd /top/of/tree2
> find -type f | xargs md5sum | sort > /tmp/tree2.md5sums
>
> diff -u /tmp/tree1.md5sums /tmp/tree2.md5sums
>
> perhaps?
Since the files are presumably Windows-related, more than likely there
are some files with spaces in the filenames. After punishing those
responsible, you will want to tweak Russell's examples slightly.
find -type f | xargs md5sum
becomes
find -type f -print0 | xargs -0 md5sum
galen
--
Galen Seitz
galens at seitzassoc.com
More information about the PLUG
mailing list