Guest User

Untitled

a guest
May 25th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. find -type f -size +3M -print0 | while IFS= read -r -d '' i; do
  2. #echo $i
  3. echo -n '.'
  4. if grep -q "$i" md5-partial.txt; then
  5. echo -n ':'; #-e "\n$i ---- Already counted, skipping.";
  6. continue;
  7. fi
  8. #md5sum "$i" >> md5.txt
  9. MD5=`dd bs=1M count=1 if="$i" status=none | md5sum`
  10. MD5=`echo $MD5 | cut -d' ' -f1`
  11. if grep "$MD5" md5-partial.txt; then echo -e "Duplicate: $i"; fi
  12. echo $MD5 $i >> md5-partial.txt
  13. done
  14.  
  15.  
  16. ## Show the duplicates
  17. #sort md5-partial.txt | uniq --check-chars=32 -d -c
  18. #sort md5-partial.txt | uniq --check-chars=32 -d -c | sort -b -n
  19. #sort md5-partial.txt | uniq --check-chars=32 -d -c | sort -b -n | cut -c 9-40 | xargs -I '{}' sh -c "grep '{}' md5-partial.txt && echo"
  20.  
  21. ## Show wasted space
  22. if [ false ] ; then
  23. sort md5-partial.txt | uniq --check-chars=32 -d -c | while IFS= read -r -d '' LINE; do
  24. HASH=`echo $LINE | cut -c 9-40`;
  25. PATH=`echo $LINE | cut -c 41-`;
  26. ls -l '$PATH' | cud -c 26-34
  27. done
  28. fi
Add Comment
Please, Sign In to add comment