[Sun 16.Dec 18:21] -2°C 71%
FreeBSD k2:~/bin
user :-# cat find_files_with_same_content.sh.sh
#!/bin/sh
#
# description:
# ^^^^^^^^^^^^
# find files with same contents/checksum in current directory
#
# usage:
# ^^^^^^
# find_files_with_same_content.sh
#
# 943222093 168 ./xplanet/xplanet-1.2.0/xplanet/markers/moon
# 943222093 168 ./xplanet/xplanet/share/xplanet/markers/moon
#####################################################################
#DATUM=`/usr/bin/date +\%Y\%m\%d`
DATUM=`/bin/date +\%Y\%m\%d`
TEMP="/var/tmp/find_files_with_same_content.sh${DATUM}"
find . -type f -exec cksum {} \; > $TEMP;
for i in `awk '{print \$1,\$2}' $TEMP|sort|uniq -c| grep -v "^ 1 "|awk '{print \$2}'`;
do grep $i $TEMP ; echo; done
rm $TEMP;
exit 0;
[Sun 16.Dec 18:21] -2°C 71%
FreeBSD k2:~/tmp
user :-# find_files_with_same_content.sh.sh
3166971749 24802 ./murx
3166971749 24802 ./old/cron.log
3166971749 24802 ./old/cron.log.kurz