#!/bin/sh # DuplicateFiles.sh # Thu Apr 3 15:35:18 PST 2008 # Chieh Cheng # http://www.CynosureX.com/ # GNU General Public License (GPL) Version 2, June 1991 scriptName=`basename "$0"` usage () { echo " Usage: ${scriptName} [ \"directory\" ]" } if [ $# -gt 1 ] then usage else directory="." if [ $# -eq 1 ] then directory="$1" fi tmpFile=`GetTempPathName.ksh "${scriptName}"` find "${directory}" -type f -exec md5sum '{}' ';' > "${tmpFile}" cat "${tmpFile}" | sort | uniq -D -w 32 rm "${tmpFile}" fi