Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

dedup

Find and act on duplicate files.

rsdedup dedup <subcommand> [options] [path]

All dedup subcommands default to the current directory if no path is given.

Subcommands

report

Find and report duplicate files. No files are modified.

rsdedup dedup report
rsdedup dedup report /home/user/photos
rsdedup dedup report --output json /data

delete

Delete duplicate files, keeping one copy per group.

rsdedup dedup delete /home/user/photos
rsdedup dedup delete --keep oldest /home/user/photos
rsdedup dedup delete --dry-run /home/user/photos
FlagDescriptionDefault
--keep <STRATEGY>Which file to keep: interactive, first, newest, oldest, shortest-pathinteractive
-n, --dry-runShow what would be done without making changesfalse

Keep strategies

StrategyDescription
interactivePrompt for each duplicate group, showing files sorted alphabetically
firstKeep the first file encountered during directory walk
newestKeep the file with the most recent modification time
oldestKeep the file with the oldest modification time
shortest-pathKeep the file with the shortest path

The default is interactive, which presents each duplicate group and lets you choose which file to keep. Use one of the other strategies for non-interactive (scripted) usage.

Replace duplicate files with hardlinks to a single copy. All file paths continue to work, but they share the same disk blocks.

rsdedup dedup hardlink /data
rsdedup dedup hardlink --dry-run /data
FlagDescriptionDefault
-n, --dry-runShow what would be done without making changesfalse

Hardlinks cannot cross filesystem boundaries. rsdedup will report an error if duplicates span different filesystems.

Replace duplicate files with symbolic links to a single copy.

rsdedup dedup symlink /data
rsdedup dedup symlink --dry-run /data
FlagDescriptionDefault
-n, --dry-runShow what would be done without making changesfalse