Skript leiab dublikaat failid: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Kprei (talk | contribs)
No edit summary
Kprei (talk | contribs)
No edit summary
Line 1: Line 1:
#!/bin/bash
DIRS=$@
find $DIRS -type f ! -empty -exec md5sum {} \;  > checksums.txt


#!/bin/bash
  cat checksums.txt | awk '{ print $1 }' | sort | uniq -d > duplicates.txt
DIRS=$@
 
find $DIRS -type f ! -empty -exec md5sum {} \; > checksums.txt
grep -f duplicates.txt checksums.txt | sort
cat checksums.txt | awk '{ print $1 }' | sort | uniq -d > duplicates.txt
grep -f duplicates.txt checksums.txt | sort





Revision as of 15:47, 30 December 2010

#!/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