Skip to content

Instantly share code, notes, and snippets.

@areyoutoo
Last active May 20, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save areyoutoo/6b46f590ad105d6994668e0ab4916d96 to your computer and use it in GitHub Desktop.
Save areyoutoo/6b46f590ad105d6994668e0ab4916d96 to your computer and use it in GitHub Desktop.
Work wants to double-check for byte-wise matches after some file servers are copied. This script compares SHA hashes for each file in the resulting trees.
find MOUNT1 -type f -exec shasum {} \; | tee logfile1
find MOUNT2 -type f -exec shasum {} \; | tee logfile2
sort -k2 logfile1 > logfile1s
sort -k2 logfile2 > logfile2s
diff -u logfile[12]s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment