Advertisement
utoft

delete duplicate files

Jun 16th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.30 KB | None | 0 0
  1.  
  2. find . -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate > duplicate_hash.txt
  3.  
  4. cat duplicate_hash.txt | uniq -w32 | cut -c 35- | sed '/^$/d' | sed -r 's/ +/\\ /g' | tr '\n' '\0' | xargs -0 -n1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement