JDUPES(1)
π jdupes(1) β finds and performs actions upon duplicate files π
okay so bestie, welcome to the JDUPES(1) page from the General Commands Manual. No cap, this is the whole vibe: jdupes finds duplicate files and then does stuff to them. Let's get into it π«Ά
πΈ NAME πΈ
jdupes β finds and performs actions upon duplicate files.
π¦ SYNOPSIS π¦
jdupes [ options ] DIRECTORIES ...
β¨ DESCRIPTION β¨
Searches the given path(s) for duplicate files. Such files are found by comparing file sizes, then partial and full file hashes, followed by a byte-by-byte comparison. The default behavior with no other "action options" specified (delete, summarize, link, dedupe, etc.) is to print sets of matching files.
Like, literally it just wants to show you the matching files unless you tell it to do something else. Periodt π
π₯ OPTIONS π₯
-@,--loudβ output annoying low-level debug info while running.-0,--print-nullβ when printing matches, use null bytes instead of CR/LF bytes, just likefind -print0does. This has no effect with any action mode other than the default "print matches" (delete, link, etc. will still print normal line endings in the output.)-1,--one-file-systemβ do not match files that are on different filesystems or devices.-A,--no-hiddenβ exclude hidden files from consideration.-b,--hash-db-opts=optβ hash database options and operations; general format:
jdupes -b option[[:|=]option_modifiers]
cleanupβ invalidates all entries in the loaded hash database that have either been deleted or changed since the database was last written. This is a destructive cleanup that can significantly reduce the size of the database after large deletions. Changes are written on program exit.backup=backup_hashdb_nameβ if a new hashdb is written, rename the old hashdb to the givenbackup_hashdb_name. Usingbackup=.will set the backup database name to'jdupes_hashdb_old.txt'.
-B,--dedupeβ call same-extents ioctl orclonefile()to trigger a filesystem-level data deduplication on disk (known as copy-on-write, CoW, cloning, or reflink); only a few filesystems support this (BTRFS; XFS whenmkfs.xfswas used with-m crc=1,reflink=1; Apple APFS).-C,--chunk-size=size-numberβ override I/O chunk size; jdupes tunes this automatically but if you have large files on mechanical hard drives, large chunks may reduce seek time penalties.
Valid values are 0-18 and represent sizes in powers of two: 0=4K, 1=8K, 2=16K, 3=32K, 4=64K, 5=128K 6=256K 7=512K, 8=1M, 9=2M, 10=4M, 11=8M, 12=16M, 13=32M, 14=64M, 15=128M, 16=256M, 17=512M, 18=1G.
-D,--debugβ if this feature is compiled in, show debugging statistics and info at the end of program execution.-d,--deleteβ prompt user for files to preserve, deleting all others (see CAVEATS below).-e,--error-on-dupeβ exit on any duplicate found with status code255.-f,--omit-firstβ omit the first file in each set of matches.-H,--hard-linksβ normally, when two or more files point to the same disk area they are treated as non-duplicates; this option will change this behavior.-h,--helpβ displays help.-i,--reverseβ reverse (invert) the sort order of matches.-I,--isolateβ isolate each command-line parameter from one another; only match if the files are under different parameter specifications.-j,--jsonβ produce JSON (machine-readable) output.-K,--break-linksβ split hard-linked file sets back into separate files as an 'undo' for-L- note: hard linking loses file metadata and
-Kcannot restore that
- note: hard linking loses file metadata and
-L,--link-hardβ replace all duplicate files with hardlinks to the first file in each set of duplicates.-m,--summarizeβ summarize duplicate file information.-M,--print-summarizeβ print matches and summarize the duplicate file information at the end.-N,--no-promptβ when used together with--delete, preserve the first file in each set of duplicates and delete the others without prompting the user.-O,--param-orderβ parameter order preservation is more important than the chosen sort; this is particularly useful with the-Noption to ensure that automatic deletion behaves in a controllable way.-o,--order=WORDβ order files according toWORD:time- sort by modification timename- sort by filename (default).-p,--permissionsβ don't consider files with different owner/group or permission bits as duplicates.-P,--print=typeβ print extra information to stdout; valid options are:early- matches that pass early size/permission/link/etc. checkspartial- files whose partial hashes matchfullhash- files whose full hashes match
-Q,--quickβ [WARNING: RISK OF DATA LOSS, SEE CAVEATS] skip byte-for-byte verification of duplicate pairs (use hashes only).-q,--quietβ hide progress indicator.-R,--recurse:β for each directory given after this option follow subdirectories encountered within (note the:at the end of option; see the Examples section below for further explanation).-r,--recurseβ for every directory given follow subdirectories encountered within.-l,--link-softβ replace all duplicate files with symlinks to the first file in each set of duplicates.-S,--sizeβ show size of duplicate files.-s,--symlinksβ follow symlinked directories.-T,--partial-onlyβ [WARNING: EXTREME RISK OF DATA LOSS, SEE CAVEATS] match based on hash of first block of file data, ignoring the rest.-U,--no-trav-checkβ disable double-traversal safety check (BE VERY CAREFUL).-u,--print-uniqueβ print only a list of unique (non-duplicate, unmatched) files.-v,--versionβ display jdupes version and compilation feature flags.-y,--hash-db=fileβ create/use a hash database text file to speed up future runs by caching file hash data.-Y,--hash-db-populateβ don't duplicate scan, only force-populate partial and full hashes in the hash database for all specified files and exit (requires-y).-X,--ext-filter=spec:infoβ exclude/filter files based on specified criteria; general format:
jdupes -X filter[:value][size_suffix]
Some filters take no value or multiple values. Filters that can take a numeric option generally support the size multipliers K/M/G/T/P/E with or without an added iB or B. Multipliers are binary-style unless the -B suffix is used, which will use decimal multipliers. For example, 16k or 16kib = 16384; 16kb = 16000. Multipliers are case-insensitive.
Filters have cumulative effects: jdupes -X size+:99 -X size-:101 will cause only files of exactly 100 bytes in size to be included.
Extension matching is case-insensitive. Path substring matching is case-sensitive.
Supported filters are:
size[+-=]:number[suffix]β match only if size is greater (+), less than (-), or equal to (=) the specified number. The+/-and=specifiers can be combined, i.e."size+=:4K"will only consider files with a size greater than or equal to four kilobytes (4096bytes).noext:ext1[,ext2,...]β exclude files with certain extension(s), specified as a comma-separated list. Do not use a leading dot.onlyext:ext1[,ext2,...]β only include files with certain extension(s), specified as a comma-separated list. Do not use a leading dot.nostr:text_stringβ exclude all paths containing the substringtext_string. This scans the full file path, so it can be used to match directories:-X nostr:dir_name/onlystr:text_stringβ require all paths to contain the substringtext_string. This scans the full file path, so it can be used to match directories:-X onlystr:dir_name/newer:datetimeβ only include files newer than specified date. Date/time format:"YYYY-MM-DD HH:MM:SS"(time is optional).older:datetimeβ only include files older than specified date. Date/time format:"YYYY-MM-DD HH:MM:SS"(time is optional).
-z,--zero-matchβ consider zero-length files to be duplicates; this replaces the old default behavior when-nwas not specified.-Z,--soft-abortβ if the user aborts the program (as with CTRL-C) act on the matches that were found before the abort was received. For example, if-Land-Zare specified, all matches found prior to the abort will be hard linked. The default behavior without-Zis to abort without taking any actions.
π NOTES π
A set of arrows are used in hard linking to show what action was taken on each link candidate. These arrows are as follows:
---->This file was successfully hard linked to the first file in the duplicate chain-@@->This file was successfully symlinked to the first file in the chain-##->This file was successfully cloned from the first file in the chain-==->This file was already a hard link to the first file in the chain-//->Linking this file failed due to an error during the linking process-/ ~>For-K, this file is no longer hard-linked to the others in the link set
Duplicate files are listed together in groups with each file displayed on a separate line. The groups are then separated from each other by blank lines.
π EXAMPLES π
jdupes a --recurse: b
will follow subdirectories under b, but not those under a.
jdupes a --recurse b
will follow subdirectories under both a and b.
jdupes -O dir1 dir3 dir2
will always place 'dir1' results first in any match set (where relevant)
π CAVEATS π
okay bestie, this is the part where we hold hands and read the fine print together, because some of these options will absolutely ruin your week if you're not paying attention π«Ά
-1,--one-file-systemβ this stops matches from crossing filesystems, periodt. but like, the author says a more relaxed form of this option may be added later that allows cross-matching for all filesystems that each parameter is present on. so rn: strict. future: maybe chill. iykyk β¨-d,--deleteβ when you use this, care should be taken to insure against accidental data loss. translating: this deletes files, bestie. be so fr with yourself before you hit enter π-Z,--soft-abortβ lore drop π«£ back in jdupes prior to v1.5 this option used to be--hardabortand did the opposite thing. defaulting to taking action on abort is probably not what most users would expect. the author chose to invert it rather than reassign it to a different option because the feature was still fairly new at the time of the change. so if you're reading ancient docs, that's why you're confused π-O,--param-orderβ this one gives you way more control over what appears in the first position of a match set, specifically so the-Noption doesn't delete all but one file in a set in a seemingly random way π here's the tea: all directories specified on the command line get used as the sorting order of result sets first, and then the sorting algorithm set by the-oor--orderoption kicks in. what that means: the order of all match pairs for a single directory specification will keep the old sorting behavior even if you specify this option. iconic but slightly feral β-s,--symlinkcombo warning π β when used together with options-sor--symlink, a user could accidentally preserve a symlink while deleting the file it points to. like, the link lives but the thing it points at is gone. not the vibe πΈ
-Q,--quickβ highkey the riskiest one here. it only reads each file once, hashes it, and performs comparisons based solely on the hashes. there's a small but significant risk of a hash collision β which is literally the entire purpose of the failsafe byte-for-byte comparison that this option explicitly bypasses. do not use it on ANY data set for which any amount of data loss is unacceptable. it's not even included in the help text for the program because of its risky nature. you have been warned! π₯π
-T,--partial-onlyβ okay so this one produces results based on a hash of the first block of file data in each file, ignoring everything else in the file. partial hash checks have always been an important exclusion step in the jdupes algorithm, usually hashing the first4096bytes of data and allowing files that are different at the start to be rejected early. in certain scenarios it may be a useful heuristic for a user to see that a set of files has the same size and the same starting data, even if the remaining data does not match. one example of this would be comparing files with data blocks that are damaged or missing β like an incomplete file transfer β or checking a data recovery against known-good copies to see what damaged data can be deleted in favor of restoring the known-good copy. this option is meant to be used with informational actions and can result in EXTREME DATA LOSS if used with options that delete files, create hard links, or perform other destructive actions on data based on the matching output. and because of the potential for massive data destruction, this option MUST BE SPECIFIED TWICE to take effect, and will error out if it is only specified once. yes, twice. it's a safety lock π§π-C,--chunk-sizeβ using this to override I/O chunk size can increase performance on rotating storage media by reducing "head thrashing," reading larger amounts of data sequentially from each file. but this tunable size can have bad side effects π¬ the default size maximizes algorithmic performance without regard to the I/O characteristics of any given device and uses a modest amount of memory, but other values may greatly increase memory usage or incur a lot more system call overhead. try several different values to see how they affect performance for your hardware and data set. good news: this option does not affect match results in any way, so even if it slows down the file matching process it will not hurt anything π-y,--hash-dbβ this feature creates and maintains a text file with a list of file paths, hashes, and other metadata that enables jdupes to "remember" file data across runs. cute detail: specifying a period.as the database file name will use a name ofjdupes_hashdb.txtinstead β this alias makes it easy to use the hash database feature without typing a descriptive name each time β¨
THIS FEATURE IS CURRENTLY UNDER DEVELOPMENT AND HAS MANY QUIRKS. USE IT AT YOUR OWN RISK. in particular, one of the biggest problems with this feature is that it stores every path exactly as specified on the command line. if any paths are passed into jdupes on a subsequent run with a different prefix, they will not be recognized and they will be treated as totally different files. for example, runningjdupes -y . foo/is not the same asjdupes -y . ./foonor the same as (from a sibling directory)jdupes -y ../foo. you must run jdupes from the same working directory and with the same path specifications to take advantage of the hash database feature. when used correctly, a fully populated hash database can reduce subsequent runs with hundreds of thousands of files that normally take a very long time to run down to the directory scanning time plus a couple of seconds. and if the directory data is already in the OS disk cache, this can make subsequent runs with over 100K files finish in under one second π€―π₯
π REPORTING BUGS π
found a bug? got a feature request? send it straight to jody@jodybruchon.com π or, for general information and help, visit http://www.jdupes.com/ β the door is open, bestie π«Ά
π SUPPORTING DEVELOPMENT π
if you find this software useful, please consider financially supporting its development through the author's home page:
https://www.jodybruchon.com/
like, genuinely β if jdupes saved your storage situation, that's the moment to give back πβ¨
π AUTHOR π
jdupes is created and maintained by Jody Bruchon <jody@jodybruchon.com> and was forked from fdupes 1.51 by Adrian Lopez <adrian2@caribe.net> β two names, one iconic lineage, we stan both πΈπ
π LICENSE π
MIT License β short, sweet, legally binding π
Copyright (c) 2015-2026 Jody Lee Bruchon <jody@jodybruchon.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
okay and that's a wrap on jdupes(1) β manual page, section 1, bestie π you just read the whole thing, front to back, and honestly? main character energy. go forth, deduplicate responsibly, and never ever run -Q on data you love ππ¦
bye bestie!! πβ¨πΈππ
π¦ where this page comes from
- arch rolling: jdupes 1.31.3-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms