[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bomb Mail



On Tue, Jun 19, 2001 at 01:49:14PM +0200, Thor wrote:
> ... ho fatto un proggy analogo (che calcola un checksum) per scoprire
>  i file duplicati anche se hanno nome ed estensioni differenti, incredibile
> quello che si trova se lo eseguite su c:\windoz :))

apt-get install fdupes
(ma non l'ho mai usato)
Oppure:
da un vecchio pacchetto debian (NON RICORDO QUALE. No, il pacchetto non
e` installato. No, non ho sottomano Contents-i386.gz)
posto il seguente breve script finddup

#!/bin/sh -

#
# finddup 1.00 - find identical files.
#
# Oleg Kibirev * April 1995 * oleg@gd.cs.CSUFresno.EDU
#
# This code is covered by General Public License, version 2 or any later
# version of your choice. You should recieve file "COPYING" which contains
# text of the license with any distribution of this program; if you don't 
# have it, a copy is available from ftp.gnu.ai.mit.edu.
#


find . -xdev -type f -printf "%p %i\n" |
egrep  "^[[:punct:][:alnum:]]+ [[:digit:]]+$" |
sort +1 |
uniq -1 |
cut -f 1 -d ' ' |
xargs md5sum |
sort +0 -1 |
(
psum='x'
line=''
many=''
while read sum file; do
  if [ "$sum" != "$psum" ]; then
    if [ ! -z "$many" ]; then
      set x $line
      k="`du $2`"
      shift 2
      echo $k "$@"
    fi
    line="$file"
    psum="$sum"
    many=''
  else
    line="$line $file"
    many=yes
  fi
done 

if [ ! -z "$many" ]; then
  set x $line
  k="`du $2`"
  shift 2
  echo $k "$@"
fi
) | sort +0 -1 -r -n



Reply to: