rdfind(1)
πΈ rdfind β the manual page, but make it make sense πΈ
okay bestie, welcome to rdfind(1) π this is the page for rdfind, a lil program that goes and finds duplicate files for you. she's simple, she's powerful, she will absolutely eat your disk space back. let's get into it π«Ά
β¨ NAME β¨
rdfind β finds duplicate files π
π¦ SYNOPSIS π¦
rdfind [ options ] directory1 | file1 [ directory2 | file2 ] ...
π DESCRIPTION π
rdfind finds duplicate files across and/or within several directories. she's smart about it too β she only calculates checksums when it's actually necessary (no wasted work, we love an efficient queen π). and directories get searched recursively, so she goes all the way down, no cap.
if two (or more) equal files show up, the program decides which one is the original and the rest get called duplicates. how? by ranking the files against each other and picking the one with the highest rank. full deets are in the RANKING section below, iykyk π
by default, she takes no action other than creating a file with the detected files and showing you the possible amount of saved space. so like, she tells you the tea but doesn't spill it β
if you need better control over the ranking than what's given, you can use some preprocessor which sorts the file names in the order you want, and then run the program using xargs. there are examples below for how to use find and xargs together with rdfind β iconic combo fr fr.
to include files or directories that have names starting with -, use rdfind ./- so you don't confuse them with options π (yes this trips everyone up, you're not alone)
π RANKING π
so given two or more equal files, the one with the highest rank gets selected as the original and the rest are duplicates. the rules run from start until an original has been found β like a little tournament π
given two files A and B which have equal size and content, the ranking goes like this:
- if
Awas found while scanning an input argument earlier thanB,Ais higher ranked. - if
Awas found at a directory depth lower thanB,Ais higher ranked (Ais closer to the root). - if
AandBare found during scanning of the same input argument and share the same directory depth, then who ranks highest depends on whether deterministic operation is enabled. this is on by default, see the-deterministicoption.- if enabled, which one ranks highest is unspecified but deterministic.
- if disabled, the one that was reported first from the file system is highest ranked.
π OPTIONS π
searching options etc: π
-ignoreempty true|falseβ ignore empty files. setting this totrue(the default) is equivalent to-minsize 1, andfalseis equivalent to-minsize 0.-minsize Nβ ignores files with less thanNbytes. default is1, meaning empty files are ignored.-maxsize Nβ ignores files withNbytes or more. default is0, which means this check is disabled.-followsymlinks true|falseβ follow symlinks. default isfalse.-removeidentinode true|falseβ removes items found which have identical inode and device ID. default istrue.-checksum none|md5|sha1|sha256|sha512|xxh128β what type of checksum to be used:md5,sha1,sha256,sha512orxxh128. the default issha1since version 1.4.0.xxh128is a very fast checksum, but not of cryptographic quality.xxhsupport is optional and requires that rdfind was configured with--with-xxhash. in casexxhis used but there is no support, an error is returned. checksumnonecan be used to skip checksumming altogether.
not recommended!! π¨ in case files of the same size have contents that differ, it is likely they are falsely considered duplicates, leading to file removal (depending on other options). like, actually read that twice bestie π
-buffersize Nβ chunksize in bytes when calculating the checksum for files. smaller or bigger can improve performance dependent on filesystem and checksum algorithm. the default is1 MiB, the maximum allowed is128MiB(inclusive).-firstbytessize Nβ size in bytes when scanning the first bytes of each file, prior to full checksumming. setting this to0means skipping the step entirely.-lastbytessize Nβ size in bytes when scanning the last bytes of each file, prior to full checksumming. setting this to0means skipping the step entirely.-deterministic true|falseβ if set (the default), sort files of equal rank in an unspecified but deterministic order. this makes the behaviour independent of in which order files are listed when querying the file system. so stable, but mysterious. main character energy honestly π
action options: π₯
-makesymlinks true|falseβ replace duplicate files with symbolic links. default isfalse.-makehardlinks true|falseβ replace duplicate files with hard links. default isfalse.-makeresultsfile true|falseβ make a results file in the current directory. default istrue. if the file exists, it is overwritten π«£ this does not affect whether items are deleted. see-dryrunfor how to disable deletions.-outputname nameβ make the results file name to benameinstead of the defaultresults.txt.-deleteduplicates true|falseβ delete (unlink) files. default isfalse.
general options: π
-progress true|falseβ show progress during elimination. defaults tofalse.-sleep Xmsβ sleepsXmilliseconds between reading each file, to reduce load. default is0(no sleep). note that only a few values are supported at present:0,1-5,10,25,50,100milliseconds.-n,-dryrun true|(false)β by default, rdfind does nothing except creating a results file. in case one of the action flags like-deleteduplicatesis set,dryruncan be set to let rdfind print what it would do, instead of actually doing it. the default isfalse.-h,-help,--helpβ displays a brief help message.-v,-version,--versionβ displays the version number.
π EXAMPLES π
search for duplicate files in the home directory and a backup directory:
rdfind ~ /mnt/backup
delete duplicates in a backup directory:
rdfind -deleteduplicates true /mnt/backup
search for duplicate files in directories called foo:
find . -type d -name foo -print0 |xargs -0 rdfind
π FILES π
results.txt (the default name is results.txt and can be changed with option outputname, see above).
the results file results.txt will contain one row per duplicate file found, along with a header row explaining the columns. a text describes why the file is considered a duplicate:
DUPTYPE_UNKNOWNβ some internal error πDUPTYPE_FIRST_OCCURRENCEβ the file that is considered to be the original. πDUPTYPE_WITHIN_SAME_TREEβ files in the same tree (found when processing the directory in the same input argument as the original)DUPTYPE_OUTSIDE_TREEβ the file is found during processing another input argument than the original.
πΈ ENVIRONMENT πΈ
(this section is empty in the original β nothing to report, bestie π€·βοΈ)
π DIAGNOSTICS π
(also empty in the original. silence is golden β¨)
β EXIT VALUES β
0on success, nonzero otherwise.
π BUGS/FEATURES π
- when specifying the same directory twice, it keeps the first encountered as the most important (original), and the rest as duplicates. this might not be what you want π
- the symlink creates absolute links. this might not be what you want. to create relative links instead, you may use the
symlinks(8)command, which is able to convert absolute links to relative links. (noted, bookmarked π) - older versions unfortunately contained a misspelling on the word occurrence. this is now corrected (since 1.3), which might affect user scripts parsing the output file written by rdfind. so if your script broke, it's giving "it's not a bug it's a spelling fix" π
π¨ SECURITY CONSIDERATIONS π¨
avoid manipulating the directories while rdfind is reading. rdfind is quite brittle in that case. especially, when deleting or making links, rdfind can be subject to a symlink attack. use with care!! π«Ά
rfind was written with the intention of deduplicating directories owned by the same user. it does not handle file ownership and permissions. it is not recommended to run it across directories with several owners.
π AUTHOR π
Paul Dreik 2006-2026, reachable at rdfind@pauldreik.se
rdfind can be found at https://rdfind.pauldreik.se/
do you find rdfind useful? drop me a line! it is always fun to hear from people who actually use it and what data collections they run it on π₯Ή (this is so sweet actually)
π THANKS π
several persons have helped with suggestions and improvements: Niels MΓΆller, Carl Payne and Salvatore Ansani. thanks also to you who tested the program and sent me feedback π«Ά
π VERSION π
1.8.0 (release date 2026-02-22)
π COPYRIGHT π
this program is distributed under GPLv2 or later, at your option.
π₯ SEE ALSO π₯
md5sum, sha1sum, find, symlinks
and that's the whole page, bestie β this was rdfind(1) from the rdfind manual, version 1.8.0, dated Feb 2026. go forth and deduplicate responsibly π
β¨π
π¦ where this page comes from
- alpine 3.24: rdfind-doc 1.8.0-r0 Β· GPL-2.0-or-later
- arch rolling: rdfind 1.8.0-2 Β· GPL-2.0-only
- fedora 43: rdfind 1.8.0-1.fc43 Β· GPL-2.0-or-later
- fedora 44: rdfind 1.8.0-1.fc44 Β· GPL-2.0-or-later
- nixpkgs unstable: rdfind 1.8.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms