X-Git-Url: https://git.wpitchoune.net/gitweb/?p=www.git;a=blobdiff_plain;f=src%2Ftricks%2Ffind_same_files.sh;fp=src%2Ftricks%2Ffind_same_files.sh;h=a1f48ae28e25a084deabc09827be12b05f025f9f;hp=0000000000000000000000000000000000000000;hb=1587eac4e9940c095ae78a6758fb6344f3aed75d;hpb=30d3073487892c62872bfc407c18cedb2247b875 diff --git a/src/tricks/find_same_files.sh b/src/tricks/find_same_files.sh new file mode 100755 index 0000000..a1f48ae --- /dev/null +++ b/src/tricks/find_same_files.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Find same files in a given directory + +set -e + +if [ -z "$1" ]; then + SDIR="." +else + SDIR="$1" +fi + +find "$SDIR" -type f -exec md5sum {} \; | sort -n | uniq -w32 -D