{"id":20269032,"url":"https://github.com/patatetom/dupdnp","last_synced_at":"2025-08-19T06:34:17.918Z","repository":{"id":256781101,"uuid":"102504358","full_name":"patatetom/dupdnp","owner":"patatetom","description":"Find duplicate files","archived":false,"fork":false,"pushed_at":"2019-04-16T09:17:07.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T23:11:35.896Z","etag":null,"topics":["duplicate-files","duplicatefilefinder","fingerprint","md5","python3","sha1","xxhash"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patatetom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-05T16:22:30.000Z","updated_at":"2019-04-16T09:17:09.000Z","dependencies_parsed_at":"2024-09-13T03:06:06.982Z","dependency_job_id":null,"html_url":"https://github.com/patatetom/dupdnp","commit_stats":null,"previous_names":["patatetom/dupdnp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patatetom/dupdnp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fdupdnp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fdupdnp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fdupdnp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fdupdnp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patatetom","download_url":"https://codeload.github.com/patatetom/dupdnp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Fdupdnp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271113421,"owners_count":24701609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["duplicate-files","duplicatefilefinder","fingerprint","md5","python3","sha1","xxhash"],"created_at":"2024-11-14T12:22:58.728Z","updated_at":"2025-08-19T06:34:17.879Z","avatar_url":"https://github.com/patatetom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dupdnp\nFind duplicate files\n\nBecause duplicate files are usually a problem, `dupdnp.py` is  \u0026nbsp;\u0026nbsp;*yet another*\u0026nbsp;\u0026nbsp; Python script to find them.\n\nThe difference lies here in the way to eliminate the unique files :\n\n* the first sort is done very logically and as often on the file size,\n* the second sort simply rests on the file header (1Kb by default or 4Kb),\n* the third sort is based on the [digital fingerprint](https://en.wikipedia.org/w/index.php?title=Message_digest) of the starting fragment (4Mb) of the file,\n* the fourth and last sort takes place on the digital fingerprint of the full file.\n\nThe digital fingerprint can be computed with [xxhash](https://github.com/Cyan4973/xxHash) (default choice, if present), md5 or sha1 (default choice, in absence of xxhash).\n\n\n\n### Full_file_name \u0026RightArrowBar; size\n\nThe search for files and their size is outsourced and entrusted here to the command-line utility `find` :\n\n```bash\nfind /path/to/search/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py\n```\n\n`-printf '%p\\t%s\\n'` print the full file name and its size in bytes, separated by a `[tab]` character.\n\n***This specific input format - `full_file_name` `[tab]` `size_in_bytes` - is the expected one !***\n\n\n\n### Metrics\n\nThe dupdnp.py metrics listed below are issued from the search of duplicate files on a typical Windows Seven workstation :\n```bash\nsudo mount /dev/sda2 /cdrom -o ro\n\nfind /cdrom/ -type f | wc -l\n66465\nfind /cdrom/ -type f -not -empty | wc -l\n66418\n\nfunction flush { sync \u0026\u0026 sudo sysctl -q vm.drop_caches=3; }\n\n# find metrics\nflush \u0026\u0026 time ( find /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' \u003e /dev/null )\nreal 0m5,089s user 0m0,150s sys 0m0,790s\n\n# dupdnp.py metrics with xxhash\nfind /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py | wc -l\n28950\nflush \u0026\u0026 time ( find /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py \u003e /dev/null )\nreal 0m58,295s user 0m4,720s sys 0m7,310s\n\n# dupdnp.py metrics with xxhash and 4k headers\nfind /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py -4 | wc -l\n28950\nflush \u0026\u0026 time ( find /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py -4 \u003e /dev/null )\nreal 0m55,900s user 0m4,910s sys 0m6,480s\n\n# dupdnp.py metrics with md5\nfind /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py --md5 | wc -l\n28950\nflush \u0026\u0026 time ( find /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py --md5 \u003e /dev/null )\nreal 1m19,165s user 0m23,700s sys 0m6,200s\n\n# dupdnp.py metrics with sha1\nfind /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py --sha1 | wc -l\n28950\nflush \u0026\u0026 time ( find /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py --sha1 \u003e /dev/null )\nreal 1m15,267s user 0m18,170s sys 0m6,430s\n\n# dupdnp.py, duff and jdupes results\nfind /cdrom/ -type f -not -empty -printf '%p\\t%s\\n' | ./dupdnp.py -4 -a | sed '/^$/d' | sort \u003e dupdnp.found\n\nduff -v\nduff 0.5.2\n...\nduff -raqzf '' /cdrom/ | sort \u003e duff.found\n\njdupes -v\njdupes 1.8 (2017-01-31) 64-bit\n...\njdupes -rqH /cdrom/ | sed '/^$/d' | sort \u003e jdupes.found\n\nwc -l *.found | grep '\\.found$'\n   49614 duff.found\n   49614 dupdnp.found\n   49614 jdupes.found\n\nmd5sum *.found\n86be9d808c1e8821bf52cd96ee581b46  duff.found\n86be9d808c1e8821bf52cd96ee581b46  dupdnp.found\n86be9d808c1e8821bf52cd96ee581b46  jdupes.found\n```\n\n\n\n### Cython\n\nThe Python script `dupdnp.py` can be compiled into an executable using Cython and Gcc :\n```bash\ncython3 --embed ./dupdnp.py\ngcc $( python3-config --cflags --libs ) ./dupdnp.c -o ./dupdnp\n```\n\n\n\n### See also\n\n- [Duff](https://github.com/elmindreda/duff)\n- [Fdupes](https://github.com/adrianlopezroche/fdupes)\n- [Jdupes](https://github.com/jbruchon/jdupes)\n- [Rdfind](https://github.com/pauldreik/rdfind)\n- [Rmlint](https://github.com/sahib/rmlint)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatatetom%2Fdupdnp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatatetom%2Fdupdnp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatatetom%2Fdupdnp/lists"}