In an archive that grows for years, duplicates are inevitable. The catch is that a “duplicate” can mean two things: exactly the same file, or two different downloads that partly cover the same days.
1. Two kinds of “duplicates”
- Identical files – the same content byte for byte, often under different names. One copy is enough.
- Overlapping downloads – different files from the same card that partly cover the same period. These are not duplicates: each is a separate record and both should be kept.
2. Identical files: compare SHA-256 checksums
Files with the same SHA-256 are identical. You can compute and group the checksums of all files in a folder, e.g. in PowerShell:
# Windows (PowerShell) – groups of identical files
Get-ChildItem -Recurse -File | Get-FileHash -Algorithm SHA256 |
Group-Object Hash | Where-Object Count -gt 1 |
ForEach-Object { $_.Group.Path; '' }
# Linux / macOS
find . -type f -exec sha256sum {} + | sort | uniq -w64 -D3. Overlapping downloads
A card stores data for many weeks, so consecutive downloads always overlap partly. When analysing days, those repeated in several files should be counted once, and when files differ for the same day, check which download is newer.