From: Jean-Philippe Orsini Date: Thu, 8 Jun 2017 00:20:29 +0000 (+0200) Subject: add script to find identical files X-Git-Url: http://git.wpitchoune.net/gitweb/?p=www.git;a=commitdiff_plain;h=1587eac4e9940c095ae78a6758fb6344f3aed75d;hp=30d3073487892c62872bfc407c18cedb2247b875 add script to find identical files --- 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