Quote:
|
Originally Posted by joeljkp
When using diff to compare the two sets of md5sums, it can't differentiate between items from different directories.
|
Not sure if I understand the part "from different directories", so I'll reply to the example.
Diff is smarter than that; it re-synchronizes.
I recreated your scenario. As we have a reasonable number of files with sensible names, the simple
md5sum `find dir1 -type f` is enough. The respective outputs are:
Code:
b026324c6904b2a9cb4b88d6d61c81d1 dir1/file1
26ab0db90d72e28ad0ba1e22ee510510 dir1/file2
6d7fce9fee471194aa8b5b6e47267f03 dir1/file3
and
Code:
b026324c6904b2a9cb4b88d6d61c81d1 dir1/file1
26ab0db90d72e28ad0ba1e22ee510510 dir1/file2
c193497a1a06b2c72230e6146ff47080 dir1/file2~
6d7fce9fee471194aa8b5b6e47267f03 dir1/file3
And when I run
diff on them, I get
Code:
2a3
> c193497a1a06b2c72230e6146ff47080 dir1/file2~
Note: my find (GNU find version 4.2.27) outputs the file names without sorting, i.e., like
ls -f does. The files may be ordered differently between the two trees, which would cause spurious differences. If that's an issue, try
md5sum `find dir1 -type f | sort` to get a predictable order.
BTW, initially you said
Quote:
|
I want to make sure everything transferred over and wasn't corrupted.
|
If diff is quiet, everything is well. If it reports any difference, the trees don't have identical content.