Examples
Scan Multiple Directories
Section titled “Scan Multiple Directories”Scan several directories together — duplicates across directories are detected:
dublette 2020 2021 2022 --dry-runUse shell glob expansion to match directories by pattern:
dublette 202* --dry-rundublette ~/Photos/*/RAW --dry-runThis is especially useful for finding photos that were copied across year folders or backup directories.
Clean Up a Photo Library
Section titled “Clean Up a Photo Library”Preview duplicates in your photos directory:
dublette ~/Photos --dry-runReview the output, then delete:
dublette ~/Photos --yesTo also remove any 0-byte corrupted files:
dublette ~/Photos --delete-empty --yesDeduplicate a Video Archive
Section titled “Deduplicate a Video Archive”Process only video files:
dublette ~/Videos --only videos --dry-runVideos are compared by extracting a frame at the 1-second mark and hashing it. This catches re-encoded copies and different containers of the same content.
Images Only (Skip Video Processing)
Section titled “Images Only (Skip Video Processing)”If you do not have ffmpeg installed, or want to avoid the overhead of frame extraction:
dublette ~/Media --only imagesAudio: Keep the Best Copy of Each Recording
Section titled “Audio: Keep the Best Copy of Each Recording”The default recording match groups the same recording across formats and bitrates, keeping the highest-fidelity copy (a flac survives its mp3 rip):
dublette ~/Music --only audio --dry-runTo only remove exact copies that differ in tags – never grouping different encodings:
dublette ~/Music --only audio --audio-match encoding --dry-runAdjust the Threshold
Section titled “Adjust the Threshold”The default threshold of 1 is conservative. To require exact perceptual matches:
dublette ~/Photos --threshold 0 --dry-runTo catch more aggressively similar files (e.g., same photo with different crops or slight edits):
dublette ~/Photos --threshold 3 --dry-runAlways preview with --dry-run when increasing the threshold.
Scripting with JSON Output
Section titled “Scripting with JSON Output”Use --json and --dry-run to get machine-readable output:
dublette ~/Photos --dry-run --json > results.jsonThe exit code indicates whether duplicates were found:
dublette ~/Photos --dry-run --json --quietif [ $? -eq 1 ]; then echo "Duplicates found"fiParse the JSON output with jq:
dublette ~/Photos --dry-run --json | jq '.groups[].duplicates[]'Count total duplicates:
dublette ~/Photos --dry-run --json | jq '.total_duplicates'CI / Automated Pipeline
Section titled “CI / Automated Pipeline”Combine --json, --quiet, and --yes for non-interactive use:
dublette /data/media --json --quiet --yes > /tmp/dedup-report.jsonUse the exit code in a CI step to detect duplicates without deleting:
dublette /data/uploads --dry-run --quietEXIT_CODE=$?if [ "$EXIT_CODE" -eq 1 ]; then echo "::warning::Duplicate media files detected"fiVerbose Output for Debugging
Section titled “Verbose Output for Debugging”To see the computed hash for each file and the hamming distance for every comparison:
dublette ~/Photos --verbose --dry-run 2> hashes.logVerbose output is written to stderr, so it can be captured separately from the table or JSON output on stdout.
Suppress Progress Bars
Section titled “Suppress Progress Bars”When piping output or running in a non-interactive terminal:
dublette ~/Photos --quiet --dry-runThis suppresses the progress bars and scanning status messages while still printing the results table.
Combine Flags
Section titled “Combine Flags”Delete all duplicates and empty files without prompts, with JSON output, no progress bars:
dublette ~/Photos --delete-empty --yes --json --quietPreview image-only duplicates with strict matching and verbose logging:
dublette ~/Photos --only images --threshold 0 --dry-run --verbose