Created
October 10, 2020 09:34
-
-
Save fuomag9/84637e44a0f96c947188d35b7aee4f55 to your computer and use it in GitHub Desktop.
delete duplicate files by md5
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
find . -type f \ | |
| xargs md5sum \ | |
| sort -k1,1 \ | |
| uniq -Dw32 \ | |
| while read hash file; do | |
[ "${prev_hash}" == "${hash}" ] && rm -v "${file}" | |
prev_hash="${hash}"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: https://superuser.com/a/1363262/745438