Just Start Typing Text and Press Enter

Menu
Close
Nov 20, 2026

How to Remove Duplicate Files on Linux (2026 Update)

0 Comment | By
Illustration of duplicate folders being scanned and organized to recover Linux disk space.

Duplicate files are easy to collect. Copy a photo folder, download the same archive twice, or bring files over from an old drive, and suddenly you have several copies of the same data taking up space.

My original Linux duplicate-file guide from 2019 mixed together FSlint and fdupes. They are different tools, and installing one does not install the other. This update separates them and adds rdfind, fclones, and a graphical option.

The important part hasn’t changed: back up your files, scan first, and check what you are about to remove. Matching contents do not automatically mean a file is safe to delete.

Which duplicate-file finder should you use?

  • rdfind: a straightforward command-line scan that writes a report, with optional delete and link actions.
  • fdupes: a good choice when you want to review duplicate groups and choose which files to keep interactively.
  • fclones: worth considering for large collections, with parallel scanning and a separate report-and-action workflow.
  • Krokiet, from the Czkawka project: a graphical option for reviewing files without living in the terminal.

You don’t need to install every tool. Start with rdfind or fdupes and one folder you understand.

Before you start deleting anything

  • Make a backup on a separate device or backup system, and check that you can restore from it. Two copies on the same disk are not a backup strategy.
  • Start with your own downloads, media, or an old import folder. Don’t point a deletion command at /, system directories, live databases, application libraries, or managed backup repositories.
  • Run scans as your normal user. Use sudo for installing packages, not as a shortcut around file permissions during cleanup.
  • Pause programs that change the files while you scan and act. Don’t run destructive scans on shared directories other people can modify.
  • Use one non-overlapping directory tree at first. Don’t pass a parent folder and its child, or the same folder twice, to a cleanup command.

The examples below use "$HOME/Downloads". Replace that with the folder you actually want to check. The quotes matter for paths with spaces. These examples find matching file contents, not merely similar photos or matching filenames.

1. Find duplicate files with rdfind

rdfind compares file contents and searches directories recursively. Its default action is to write a report, not delete files.

On Debian or Ubuntu:

sudo apt update
sudo apt install rdfind

On Fedora:

sudo dnf install rdfind

Start with a report-only scan:

rdfind -dryrun true "$HOME/Downloads"

It writes results.txt in the directory where you ran the command, not necessarily the directory you scanned. An existing report with that name is overwritten, so save it elsewhere if you need to keep it.

Open the report in a text editor. The entry marked DUPTYPE_FIRST_OCCURRENCE is the copy rdfind considers the original. That is a ranking decision, not proof it is your preferred copy. Earlier input directories take priority, then shallower paths. Ties use a deterministic order that you should not assume means newest, oldest, or best.

Reviewing this report does not approve a fixed deletion list. A later rdfind command scans again. If you only want to remove selected files, use a file manager or the interactive fdupes workflow below rather than treating rdfind’s report as a script.

Optional: preview automatic deletion

Only use this if you agree with rdfind’s choice of which copy survives in every group. Preview that exact action first:

rdfind -dryrun true -deleteduplicates true "$HOME/Downloads"

The following command actually removes the lower-ranked copies. It does not ask which one to keep and does not move files to the desktop Trash:

rdfind -deleteduplicates true "$HOME/Downloads"

Keep the files unchanged between the preview and the real run. A scan is not a backup, and there is no general undo button.

2. Review and delete interactively with fdupes

fdupes is still a useful option. Its normal matching process includes byte-for-byte confirmation, and its delete mode lets you choose the files to preserve.

On Debian or Ubuntu:

sudo apt update
sudo apt install fdupes

On Fedora:

sudo dnf install fdupes

List duplicate groups recursively without deleting anything:

fdupes -r "$HOME/Downloads"

After reviewing the groups, start interactive deletion:

fdupes -r -d "$HOME/Downloads"

Read the prompt carefully: you select files to keep, and the other files in that group are deleted. Don’t add -N or --noprompt unless you intentionally want to skip that review. Don’t add symlink-following options or scan the same directory twice. The project’s documentation warns that those combinations can cause data loss.

3. Use fclones for a report-and-action workflow

fclones uses parallel processing and separates finding duplicates from acting on them. Check the project’s installation instructions for your distribution and architecture rather than assuming it is in every package repository.

Once installed, create a report and preview a removal plan:

fclones group "$HOME/Downloads" > dupes.txt
fclones remove --dry-run < dupes.txt

Review both the report and the proposed actions. By default, the order within each group determines which copy is kept. If everything is correct and the files have not changed, this command performs the removal:

fclones remove < dupes.txt

Don’t pipe a scan straight into a removal command for your first cleanup. Keeping the report gives you a chance to inspect the plan. It still isn’t a backup.

4. Prefer a GUI? Look at Krokiet and Czkawka

The Czkawka project offers duplicate-file tools and a graphical frontend called Krokiet. The current project documentation recommends Krokiet for new and existing GUI users; the older GTK Czkawka GUI has reached its last release.

For exact duplicates, choose a content/hash-based comparison, select the folders to include, and review the groups before removing anything. Name-only or size-only matches are not enough to prove files are identical.

The project’s similar-image and similar-video tools solve a different problem. A resized photo may look the same but still be a file you want to keep. Don’t treat similarity results as safe automatic deletions.

Another command-line option is jdupes, a fork of fdupes. Use its own documentation for the version you install rather than assuming every fdupes flag behaves identically.

Hard links can save space, but they change file behavior

Diagram comparing independent copies with hard-linked names sharing one underlying file.
Illustration: hard links preserve names, not independent copies.

rdfind can replace matching files with hard links. That keeps the paths but makes them refer to one underlying file. To preview:

rdfind -dryrun true -makehardlinks true "$HOME/Downloads"

If you deliberately want that behavior, this command makes the changes:

rdfind -makehardlinks true "$HOME/Downloads"

I would not make hard links the default answer for every cleanup. They must be on the same filesystem, and the linked names share contents, ownership, and permissions. An in-place edit through one name affects the others. Some programs save by replacing a file instead, which can break the link. Matching contents also do not mean the files have matching metadata.

That makes hard links a poor substitute for independent backup copies. Use them only when shared-file behavior is intentional. Symbolic links have different tradeoffs, including breaking when their target moves or is removed, so they aren’t a drop-in fix either.

What about Btrfs and XFS deduplication?

Filesystem deduplication can share identical stored data while keeping files logically separate. With copy-on-write, later changes can allocate new blocks instead of changing every file, unlike a hard link.

duperemove supports Btrfs and reflink-enabled XFS. bees is specifically for Btrfs and works at whole-filesystem scope. They are not interchangeable tools for any Linux filesystem.

That is an advanced storage task with its own requirements and tradeoffs, including metadata use and fragmentation. Check your filesystem and the current tool documentation before proceeding. Don’t use a Btrfs command on ext4 and expect the same result.

Will duplicate cleanup actually free that much disk space?

The size of matching files is not always the amount of space you will recover. Existing hard links or shared extents may already avoid storing a second copy. Snapshots can retain data after you delete a file. Compression, sparse files, and files still held open by a program also affect what your disk-space tools report.

Moving a duplicate into a holding folder on the same filesystem is useful for review, but it does not free its data blocks. Moving it to Trash usually does not either until Trash is emptied. Keep a separate backup, verify your remaining files, and compare filesystem usage after cleanup rather than promising yourself the scanner’s entire estimated saving.

My recommendation

Start small. Use rdfind to see what is duplicated, or fdupes if you want to choose the surviving files interactively. Consider fclones for a larger report-driven job and Krokiet if you prefer a GUI.

The best cleanup isn’t the one that deletes the most files. It’s the one that gives you space back without removing something you still need.

Command syntax and project guidance checked November 20, 2026. Package versions vary by distribution. Read the installed tool’s help and manual before running any command that deletes or replaces files.

Leave A Comment

DON'T MISS ANY UPDATES