Skript leiab dublikaat failid

From ICO wiki
Revision as of 15:48, 30 December 2010 by Kprei (talk | contribs)
Jump to navigationJump to search
#!/bin/bash
DIRS=$@
find $DIRS -type f ! -empty -exec md5sum {} \;  > checksums.txt
cat checksums.txt | awk '{ print $1 }' | sort | uniq -d > duplicates.txt
grep -f duplicates.txt checksums.txt | sort


Skripti käivitades peab andma käsu, millistest kataloogidest dublikaat faile otsitakse, näiteks:

bash dublikaadid.sh /var /home