jdupes: How to Find, Delete, or Hard-Link Duplicate Files
jdupes is the fdupes fork that also runs on Windows and can replace duplicates with links instead of deleting them. Here is how to install it, the commands you will actually use, and how to keep the right copy.
Quick Answer
jdupes is a command-line duplicate file finder for Linux, macOS, and Windows, forked from fdupes. Run jdupes -r ~/Pictures to list identical files in a folder and its subfolders, jdupes -rd ~/Pictures to choose which copy to keep and delete the rest, or jdupes -rL ~/Pictures to replace the extra copies with hard links. It compares sizes, then hashes, then every byte, so it only reports exact copies.
The options and wording below follow the jdupes manual page as packaged by Debian (the 1.31 series) and the project's source on Codeberg. Run jdupes -v to see your version and jdupes -h if an option here is missing from an older build.
Install jdupes
# Debian, Ubuntu, Linux Mint
sudo apt install jdupes
# Fedora
sudo dnf install jdupes
# Arch, Manjaro
sudo pacman -S jdupes
# openSUSE
sudo zypper install jdupes
# macOS with Homebrew
brew install jdupes
# Check the version
jdupes -vOn Windows, download a build from the project's releases page at codeberg.org/jbruchon/jdupes, unzip it, and run jdupes.exe from a terminal. The project moved from GitHub to Codeberg, so treat Codeberg as the source of truth for downloads.
Find Duplicate Files with jdupes
Give jdupes one or more files or directories. Without -r it only looks at files directly inside each directory; with -r it follows every subdirectory.
$ jdupes -r ~/Pictures
/home/sam/Pictures/2024/IMG_0412.jpg
/home/sam/Pictures/phone-backup/IMG_0412.jpg
/home/sam/Pictures/2023/scan.pdf
/home/sam/Pictures/Downloads/scan (1).pdfEach block separated by a blank line is one set of identical files. Names do not matter, only contents. Nothing has been changed on disk at this point. The variations you will use most:
# Show the size of each set
jdupes -rS ~/Pictures
# Summary only: how many duplicates, how much space
jdupes -rm ~/Pictures
# The list, then the summary at the end
jdupes -rM ~/Pictures
# Skip hidden files
jdupes -rA ~/Pictures
# Only files of 1 MiB or more
jdupes -r -X size+=:1M ~/Videos
# Only JPEG and PNG files (no leading dot, case-insensitive)
jdupes -r -X onlyext:jpg,jpeg,png ~/Pictures
# Skip anything with node_modules/ in its path
jdupes -r -X nostr:node_modules/ ~/projects
# Several directories at once
jdupes -r ~/Pictures /mnt/backup/Pictures
# Save the list to a file, without the progress indicator
jdupes -rq ~/Pictures > duplicates.txt
# Machine-readable output for a script
jdupes -rj ~/Pictures > duplicates.json-X filters stack: -X size+=:1M -X onlyext:mp4,mkv keeps only video files of 1 MiB or more. Size suffixes are binary (1M is 1,048,576 bytes); write 1MB for the decimal million. Other filters are noext:, onlystr:, newer: and older: with a date such as "2026-01-01".
jdupes can also answer the opposite question. jdupes -ru ~/Pictures /mnt/backup/Pictures prints only the files that have no identical copy anywhere in the paths given, which is a quick way to spot what a backup is missing.
jdupes vs fdupes
jdupes was forked from fdupes 1.51, so the basics (-r, -S, -m, -f, -d, -N) work the same way. The differences that change what you type:
| jdupes | fdupes | |
|---|---|---|
| Zero-length files | Ignored by default; -z includes them | Included by default; -n excludes them |
| Replace duplicates with links | -L hard links, -l symlinks, -B reflinks | No link action |
| Size filter | -X size+=:1M and friends | -G / -L in bytes |
| Extension, path, and date filters | -X onlyext:, noext:, nostr:, newer: | None |
| Match only across directories | -I (isolate) | Post-process the output |
| JSON output | -j | No |
| Native Windows build | Yes | No (use WSL) |
| Delete interface | Line prompt | Full-screen interface in 2.x, line prompt with -P |
Watch the letter -L: in fdupes it is a maximum file size, in jdupes it hard-links every duplicate without asking. Do not carry fdupes commands over from memory. jdupes is also generally the faster of the two on large trees, though how much depends on your disks and data. If you are staying with the original, see the fdupes guide.
jdupes Options Worth Knowing
| Option | What it does |
|---|---|
-r | Follow subdirectories of every directory given |
-S | Show the size of duplicate files |
-m / -M | Print a summary only / print matches, then the summary |
-A / -z | Exclude hidden files / treat zero-length files as duplicates |
-X filter:value | Filter by size, extension, path substring, or date |
-f | Omit the first file in each set from the output |
-u | Print only unique (unmatched) files |
-o time|name / -i | Sort by modification time or name (the default) / reverse the order |
-O | Make command-line parameter order outrank the sort order |
-I | Only match files that sit under different command-line parameters |
-d | Prompt for the files to keep in each set and delete the others |
-N | With -d: keep the first file in each set, delete the rest, no prompt |
-L / -l | Replace duplicates with hard links / symlinks to the first file in each set |
-B | Copy-on-write dedupe (Btrfs, reflink-enabled XFS, APFS) |
-H | Treat files that are already hard-linked together as duplicates (off by default) |
-1 | Do not match files that are on different filesystems or devices |
-p | Do not match files with a different owner, group, or permission bits |
-j / -q | JSON output / hide the progress indicator |
-y FILE | Cache file hashes in a text file to speed up later runs |
-e | Exit with status 255 as soon as any duplicate is found (useful in CI checks) |
Delete Duplicates Safely with jdupes
jdupes removes files outright; nothing goes to the trash. Work in three steps, and stop after any step that surprises you.
1. Preview what would go
# Every file except the first in each set
jdupes -rf ~/PicturesThis is the list -dN would delete. "First" means first by name unless you change it with -o time, -i, or -O. If a copy you want to keep is in the list, adjust the order and preview again.
2. Delete interactively
$ jdupes -rd ~/Pictures
[1] /home/sam/Pictures/2024/IMG_0412.jpg
[2] /home/sam/Pictures/phone-backup/IMG_0412.jpg
Set 1 of 2: keep which files? (1 - 2, [a]ll, [n]one, [l]ink all, [s]ymlink all):Type the number of the copy to keep, or several separated by commas (1,3); ranges such as 1-3 are not accepted. a keeps the whole set. Read n carefully: it means keep none, not "no". The link choices appear on builds that include them, so an older package may show a shorter prompt.
3. Or delete without prompting
# Keeps the first file in each set, deletes the rest
jdupes -rdN ~/PicturesKeep One Folder, Clean the Other
The usual job: archive/ is the tidy copy, new/ is a dump from a phone or an old drive, and you want to remove from new/ whatever the archive already holds. Two options do most of the work. -I only matches files that sit under different parameters, so duplicates inside one folder are left alone. -O puts files from the first parameter first in each set, so the archive copy is the one kept.
# Preview: files that would be deleted
jdupes -r -I -O -f archive new
# Safety check: this must print nothing
jdupes -r -I -O -f -q archive new | grep -v -e '^new/' -e '^#x27;
# Delete them
jdupes -r -I -O -dN archive newRun the safety check every time. When the archive itself holds two copies of a file that also exists in new/, the second archive copy can land in the delete list. If the check prints any path, delete interactively with -d instead of -dN.
jdupes tells you which files are the same. To see which files are missing from one side or have changed, see how to compare folders on Linux.
Reclaim Space Without Deleting: Hard Links, Symlinks, Reflinks
This is the main reason people choose jdupes over fdupes. Instead of removing the extra copies, it can point them at the same data, so every path keeps working and the space is still freed.
# Replace duplicates with hard links to the first file in each set
$ jdupes -rL ~/Pictures
[SRC] /home/sam/Pictures/2024/IMG_0412.jpg
----> /home/sam/Pictures/phone-backup/IMG_0412.jpg
# Replace duplicates with symlinks instead
jdupes -rl ~/Pictures
# Copy-on-write dedupe: Btrfs, XFS made with reflink=1, or APFS
jdupes -rB ~/Pictures| Action | After it runs | Know before you use it |
|---|---|---|
-L hard link | Both names point at one copy of the data | Same filesystem only. Editing the file in place through one name changes it under the other. Both names share one set of permissions and timestamps |
-l symlink | Duplicates become pointers to the first file | Delete or move the first file and the links break |
-B reflink | Files share disk blocks but stay independent | Editing one copy does not change the other. Needs a filesystem that supports it; elsewhere it fails |
None of the three asks for confirmation and none has a dry-run flag, so run the plain jdupes -rS listing first. On later runs, files that are already hard-linked to each other are not reported again unless you add -H. Hard links suit read-only material such as photo archives and install media; for files you still edit, prefer -B where the filesystem allows it.
jdupes on Windows
jdupes runs natively on Windows, so you do not need WSL. Open PowerShell in the folder where you unzipped it and quote any path that contains spaces:
# List duplicates with sizes
.\jdupes.exe -rS "D:\Photos"
# Preview, then hard-link duplicates on an NTFS drive
.\jdupes.exe -rf "D:\Photos"
.\jdupes.exe -rL "D:\Photos"NTFS allows at most 1,023 hard links to one file, which only matters for a file with a very large number of copies. Hard links cannot cross drives, so add -1 when you pass paths on more than one volume and plan to link. If you would rather not use a terminal, see how to find duplicate files on Windows.
jdupes Options That Can Lose Data
The manual flags these itself
- -s with -d. When symlinked directories are followed, you can keep a symlink and delete the real file it points to.
- -Q (quick). Skips the byte-for-byte check and trusts hashes alone. The manual says not to use it on any data where loss is unacceptable.
- -T -T (partial only). Matches on the hash of the first block of each file and ignores the rest. It must be given twice to work at all; never combine it with
-d,-L, or-B. - -dN on the default order. "First" is first by name, not the copy in your tidy folder. Preview with
-f, and use-Oto make directory order decide.
Also remember that identical files are sometimes meant to be there. Package caches, node_modules, git objects, and application data contain legitimate duplicates, and hard-linking them can break software that expects to rewrite one copy. Point jdupes at your own documents, photos, and downloads, not at / or a whole home directory.
When You Want to Review Before Anything Moves
jdupes is excellent for scripted clean-ups and for linking large read-only collections. Its limits show on a family photo archive or a shared drive, where you want to see the sets side by side, decide folder by folder, and be able to take it back. jdupes acts immediately and has no undo.
FolderManifest is a desktop app for Windows 10/11, macOS, and Linux that finds duplicates the same strict way, by exact SHA-256 content match, then puts the clean-up into a plan you review and approve, with undo. Like jdupes, it does not detect similar photos or re-encoded audio; for those, use a similarity tool such as Czkawka or dupeGuru. It does not hard-link or reflink files, which jdupes does. It also compares folders and verifies copies and backups against a SHA-256 manifest, which jdupes does not do.
You may not need it
If you are comfortable in a terminal and have a backup, jdupes with a -f preview is enough for most clean-ups, and it is free. A reviewable plan with undo is worth it when the files are irreplaceable or someone else has to sign off on what gets removed.
Frequently Asked Questions
What is jdupes?
jdupes is a free, open-source command-line program that finds identical files in the paths you give it. It compares file sizes, then partial and full file hashes, then confirms each match byte by byte. It can list the duplicates, delete them, or replace them with hard links, symlinks, or copy-on-write clones.
What is the difference between jdupes and fdupes?
jdupes began as a fork of fdupes 1.51. The listing and delete options are nearly the same, but jdupes adds hard-linking (-L), symlinking (-l), filesystem-level dedupe (-B), parameter isolation (-I), extended filters (-X), JSON output (-j), and a hash database (-y). It also ignores zero-length files by default, where fdupes needs -n to do that.
How do I install jdupes?
It is packaged by the main distributions: sudo apt install jdupes on Debian and Ubuntu, sudo dnf install jdupes on Fedora, sudo pacman -S jdupes on Arch, and sudo zypper install jdupes on openSUSE. On macOS use brew install jdupes. The project also publishes Windows builds on its Codeberg releases page.
Does jdupes delete files automatically?
Not unless you ask. Plain jdupes only lists duplicates. With -d it prompts for which files to keep in each set. Only -dN deletes without prompting, keeping the first file in each set. The -L, -l, and -B actions also run without a prompt, so preview the list first.
Which file does jdupes -dN keep?
The first file in each set. By default files are sorted by name; -o time sorts by modification time and -i reverses the order. Adding -O makes the order of the directories on the command line take priority, so the copy under the first directory you name is the one kept.
Does jdupes work on Windows?
Yes. Unlike fdupes, jdupes has native Windows builds, so you can run jdupes.exe from PowerShell or Command Prompt without WSL. Hard-linking with -L works on NTFS, which allows at most 1,023 hard links per file.
Does jdupes find similar photos or songs?
No. jdupes only matches files whose contents are 100% identical. A resized photo, a re-encoded MP3, or a re-saved document is a different file to jdupes. For near-duplicates you need a similarity tool such as Czkawka or dupeGuru.
Find Exact Duplicates, Review the Plan, Keep an Undo
SHA-256 duplicate detection with a clean-up plan you approve before anything moves. Windows, Mac, and Linux. 7-day free trial, no card required, 30-day money-back guarantee.
