Created
April 1, 2024 09:29
-
-
Save dima2306/01a45a5a9617d8fae3b9c1741c3f6698 to your computer and use it in GitHub Desktop.
How to find 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
| # | |
| # look for files of size 512Kb or more (for movies can be set to something large) | |
| # if file size differs, files are different | |
| # if file size is same, compare their MD5 hashes | |
| # if hashes match, output these files as duplicates | |
| # | |
| # Author: https://www.reddit.com/r/synology/comments/10yxgjq/comment/j80p942 | |
| # | |
| find . -not -empty -links 1 -type f -size +512k -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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment