Skip to content

Examples

Scan several directories together — duplicates across directories are detected:

Terminal window
dublette 2020 2021 2022 --dry-run

Use shell glob expansion to match directories by pattern:

Terminal window
dublette 202* --dry-run
dublette ~/Photos/*/RAW --dry-run

This is especially useful for finding photos that were copied across year folders or backup directories.

Preview duplicates in your photos directory:

Terminal window
dublette ~/Photos --dry-run

Review the output, then delete:

Terminal window
dublette ~/Photos --yes

To also remove any 0-byte corrupted files:

Terminal window
dublette ~/Photos --delete-empty --yes

Process only video files:

Terminal window
dublette ~/Videos --only videos --dry-run

Videos 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.

If you do not have ffmpeg installed, or want to avoid the overhead of frame extraction:

Terminal window
dublette ~/Media --only images

Audio: 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):

Terminal window
dublette ~/Music --only audio --dry-run

To only remove exact copies that differ in tags – never grouping different encodings:

Terminal window
dublette ~/Music --only audio --audio-match encoding --dry-run

The default threshold of 1 is conservative. To require exact perceptual matches:

Terminal window
dublette ~/Photos --threshold 0 --dry-run

To catch more aggressively similar files (e.g., same photo with different crops or slight edits):

Terminal window
dublette ~/Photos --threshold 3 --dry-run

Always preview with --dry-run when increasing the threshold.

Use --json and --dry-run to get machine-readable output:

Terminal window
dublette ~/Photos --dry-run --json > results.json

The exit code indicates whether duplicates were found:

Terminal window
dublette ~/Photos --dry-run --json --quiet
if [ $? -eq 1 ]; then
echo "Duplicates found"
fi

Parse the JSON output with jq:

Terminal window
dublette ~/Photos --dry-run --json | jq '.groups[].duplicates[]'

Count total duplicates:

Terminal window
dublette ~/Photos --dry-run --json | jq '.total_duplicates'

Combine --json, --quiet, and --yes for non-interactive use:

Terminal window
dublette /data/media --json --quiet --yes > /tmp/dedup-report.json

Use the exit code in a CI step to detect duplicates without deleting:

Terminal window
dublette /data/uploads --dry-run --quiet
EXIT_CODE=$?
if [ "$EXIT_CODE" -eq 1 ]; then
echo "::warning::Duplicate media files detected"
fi

To see the computed hash for each file and the hamming distance for every comparison:

Terminal window
dublette ~/Photos --verbose --dry-run 2> hashes.log

Verbose output is written to stderr, so it can be captured separately from the table or JSON output on stdout.

When piping output or running in a non-interactive terminal:

Terminal window
dublette ~/Photos --quiet --dry-run

This suppresses the progress bars and scanning status messages while still printing the results table.

Delete all duplicates and empty files without prompts, with JSON output, no progress bars:

Terminal window
dublette ~/Photos --delete-empty --yes --json --quiet

Preview image-only duplicates with strict matching and verbose logging:

Terminal window
dublette ~/Photos --only images --threshold 0 --dry-run --verbose