Created
July 10, 2013 19:06
-
-
Save alishir/5969189 to your computer and use it in GitHub Desktop.
remove duplicate files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| duff -r * > duplicate.txt | |
| csplit -z -f dup_ duplicate.txt /files\ in\ cluster/ {*} | |
| for dup in `ls dup_*`; | |
| do | |
| cat $dup | while read l; | |
| do | |
| if [[ $l =~ .*_.* ]]; | |
| then | |
| echo "keep: $l"; | |
| else rm "$l"; | |
| fi; | |
| done; | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment