# 5 Best Tools to Find and Remove Duplicate Files in Linux

<header aria-label="Content" class="entry-header" id="bkmrk-marin-todorovlast-up"><div class="entry-meta"><span class="byline"><span class="author vcard">[<span class="author-name">Marin Todorov</span>](https://www.tecmint.com/author/marintodorov89/ "View all posts by Marin Todorov")</span></span><span class="posted-on"><time class="entry-date updated-date" datetime="2023-07-14T07:47:13+05:30">Last Updated: July 14, 2023</time></span> <span class="cat-links"><span class="screen-reader-text">Categories</span>[Linux Commands](https://www.tecmint.com/category/linux-commands/)</span> <span class="comments-link">[34 Comments](https://www.tecmint.com/find-and-delete-duplicate-files-in-linux/#comments)</span></div><div class="hide-on-mobile"><center></center>  
</div></header>Organizing your home directory or even system can be particularly hard if you have the habit of downloading all kinds of stuff from the internet using your [download managers](https://www.tecmint.com/download-managers-for-linux/ "Download Managers for Linux").

Often you may find you have downloaded the same mp3, pdf, and epub (and all kinds of [other file extensions](https://www.tecmint.com/find-file-types-in-linux/ "Find File Types in Linux")) and [copied it to different directories](https://www.tecmint.com/cp-command-examples/ "Copy Files in Linux"). This may cause your directories to become cluttered with all kinds of useless duplicated stuff.

In this tutorial, you are going to learn how to find and delete duplicate files in Linux using **rdfind**, **fdupes,** and **rmlint** command-line tools, as well as using GUI tools called **DupeGuru** and [FSlint](https://www.tecmint.com/fslint-find-and-remove-duplicate-unwanted-files-in-linux/).

A note of caution – always be careful what you delete on your system as this may lead to unwanted data loss. If you are using a new tool, first try it in a [test directory where deleting files](https://www.tecmint.com/remove-directory-linux/ "Delete Directory in Linux") will not be a problem.

## 1. Rdfind – Find Duplicate Files in Linux

**[Rdfind](https://github.com/pauldreik/rdfind "Rdfind - Find Duplicate Files")** comes from redundant data find, which is a free command-line tool used to find duplicate files across or within multiple directories. It recursively scans directories and identifies files that have identical content, allowing you to take appropriate actions such as deleting or moving the duplicates.

**Rdfind** uses an algorithm to classify the files and detects which of the duplicates is the original file and considers the rest as duplicates.

The rules of ranking are:

<div class="entry-content" id="bkmrk-if%C2%A0a%C2%A0was-found-while" itemprop="text">- If **A** was found while scanning an input argument earlier than **B**, **A** is higher ranked.
- If **A** was found at a depth lower than **B**, **A** is higher ranked.
- If **A** was found earlier than **B**, **A** is higher ranked.

</div>The last rule is used particularly when two files are found in the same directory.

### Install Rdfind on Linux

To install **rdfind** in Linux, use the following command as per your Linux distribution.

```
$ sudo apt install rdfind         [On <strong>Debian, Ubuntu and Mint</strong>]
$ sudo yum install rdfind         [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>]
$ sudo emerge -a sys-apps/rdfind  [On <strong>Gentoo Linux</strong>]
$ sudo apk add rdfind             [On <strong>Alpine Linux</strong>]
$ sudo pacman -S rdfind           [On <strong>Arch Linux</strong>]
$ sudo zypper install rdfind      [On <strong>OpenSUSE</strong>]    
```

To run **rdfind** on a directory simply type **rdfind** and the target directory.

```
$ rdfind /home/user
```

<div class="entry-content" id="bkmrk-find-duplicate-files" itemprop="text"><figure aria-describedby="caption-attachment-30913" class="wp-caption aligncenter" id="bkmrk-find-duplicate-files-1">![Find Duplicate Files in Linux](https://www.tecmint.com/wp-content/uploads/2018/10/Find-Duplicate-Files-in-Linux.png)<figcaption class="wp-caption-text" id="bkmrk-find-duplicate-files-2">Find Duplicate Files in Linux</figcaption></figure></div>As you can see **rdfind** will save the results in a file called **results.txt** located in the same directory from where you ran the program. The file contains all the duplicate files that rdfind has found. You can review the file and remove the duplicate files manually if you want to.

Another thing you can do is to use the `-dryrun` an option that will provide a list of duplicates without taking any actions:

```
$ rdfind -dryrun true /home/user
```

When you find the duplicates, you can choose to replace them with hard links.

```
$ rdfind -makehardlinks true /home/user
```

And if you wish to delete the duplicates you can run.

```
$ rdfind -deleteduplicates true /home/user
```

To check other useful options of **rdfind** you can use the **rdfind** manual.

```
$ man rdfind 
```

## 2. Fdupes – Scan for Duplicate Files in Linux

[Fdupes](https://www.tecmint.com/fdupes-find-and-delete-duplicate-files-in-linux/) is another command-line program that allows you to identify duplicate files on your system. It searches directories recursively, comparing file sizes and content to identify duplicates.

It uses the following methods to determine duplicate files:

<div class="entry-content" id="bkmrk-comparing-partial-md" itemprop="text">- Comparing partial md5sum signatures
- Comparing full md5sum signatures
- byte-by-byte comparison verification

</div>Just like **rdfind,** it has similar options:

<div class="entry-content" id="bkmrk-search-recursively-e" itemprop="text">- Search recursively
- Exclude empty files
- Shows the size of duplicate files
- Delete duplicates immediately
- Exclude files with a different owner

</div>### Install Fdupes in Linux

To install **fdupes** in Linux, use the following command as per your Linux distribution.

```
$ sudo apt install fdupes         [On <strong>Debian, Ubuntu and Mint</strong>]
$ sudo yum install fdupes         [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>]
$ sudo emerge -a sys-apps/fdupes  [On <strong>Gentoo Linux</strong>]
$ sudo apk add fdupes             [On <strong>Alpine Linux</strong>]
$ sudo pacman -S fdupes           [On <strong>Arch Linux</strong>]
$ sudo zypper install fdupes      [On <strong>OpenSUSE</strong>]    
```

**Fdupes** syntax is similar to **rdfind**. Simply type the command followed by the directory you wish to scan.

```
$ fdupes <dir>
```

To search files recursively, you will have to specify the `-r` an option like this.

```
$ fdupes -r <dir>
```

You can also specify multiple directories and specify a **dir** to be searched recursively.

```
$ fdupes <dir1> -r <dir2>
```

To have fdupes calculate the size of the duplicate files use the `-S` option.

```
$ fdupes -S <dir>
```

To gather summarized information about the found files use the `-m` option.

```
$ fdupes -m <dir>
```

<div class="entry-content" id="bkmrk-scan-duplicate-files" itemprop="text"><figure aria-describedby="caption-attachment-30915" class="wp-caption aligncenter" id="bkmrk-scan-duplicate-files-1">![Scan Duplicate Files in Linux](https://www.tecmint.com/wp-content/uploads/2018/10/Scan-Duplicate-Files-in-Linux.png)<figcaption class="wp-caption-text" id="bkmrk-scan-duplicate-files-2">Scan Duplicate Files in Linux</figcaption></figure></div>Finally, if you want to delete all duplicates use the `-d` an option like this.

```
$ fdupes -d <dir>
```

**Fdupes** will ask which of the found files to delete. You will need to enter the file number:

<div class="entry-content" id="bkmrk-delete-duplicate-fil" itemprop="text"><figure aria-describedby="caption-attachment-30916" class="wp-caption aligncenter" id="bkmrk-delete-duplicate-fil-1">![Delete Duplicate Files in Linux](https://www.tecmint.com/wp-content/uploads/2018/10/Delete-Duplicate-Files-in-Linux.png)<figcaption class="wp-caption-text" id="bkmrk-delete-duplicate-fil-2">Delete Duplicate Files in Linux</figcaption></figure></div>A solution that is definitely not recommended is to use the `-N` option which will result in preserving the first file only.

```
$ fdupes -dN <dir>
```

To get a list of available options to use with **fdupes** review the help page by running.

```
$ fdupes -help
```

## 3. Rmlint – Remove Duplicate Files

[Rmlint](https://github.com/sahib/rmlint "Rmlint - Remove Duplicate Files") is a command-line tool that is used for finding and removing duplicate and lint-like files in Linux systems. It helps identify files with identical content, as well as various forms of redundancy or lint, such as empty files, broken symbolic links, and orphaned files.

### Install Rmlint on Linux

To install **Rmlint** in Linux, use the following command as per your Linux distribution.

```
$ sudo apt install rmlint         [On <strong>Debian, Ubuntu and Mint</strong>]
$ sudo yum install rmlint         [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>]
$ sudo emerge -a sys-apps/rmlint  [On <strong>Gentoo Linux</strong>]
$ sudo apk add rmlint             [On <strong>Alpine Linux</strong>]
$ sudo pacman -S rmlint           [On <strong>Arch Linux</strong>]
$ sudo zypper install rmlint      [On <strong>OpenSUSE</strong>]    
```

<div class="entry-content" id="bkmrk-rmlint-%E2%80%93-remove-dupl" itemprop="text"><figure aria-describedby="caption-attachment-51920" class="wp-caption aligncenter" id="bkmrk-rmlint-%E2%80%93-remove-dupl-1">![Rmlint - Remove Duplicate Files](https://www.tecmint.com/wp-content/uploads/2018/11/Rmlint-Remove-Duplicate-Files.png)<figcaption class="wp-caption-text" id="bkmrk-rmlint-%E2%80%93-remove-dupl-2">Rmlint – Remove Duplicate Files</figcaption></figure></div>## 4. dupeGuru – Find Duplicate Files in a Linux

**[dupeGuru](https://dupeguru.voltaicideas.net/ "dupeGuru - Find Duplicate Files")** is an open-source and cross-platform tool that can be used to find duplicate files in a Linux system. The tool can either scan filenames or content in one or more folders. It also allows you to find the filename that is similar to the files you are searching for.

**dupeGuru** comes in different versions for Windows, Mac, and Linux platforms. Its quick fuzzy matching algorithm feature helps you to find duplicate files within a minute. It is customizable, you can pull the exact duplicate files you want to, and Wipeout unwanted files from the system.

### Install dupeGuru on Linux

To install **dupeGuru** in Linux, use the following command as per your Linux distribution.

```
$ sudo apt install dupeguru         [On <strong>Debian, Ubuntu and Mint</strong>]
$ sudo yum install dupeguru         [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>]
$ sudo emerge -a sys-apps/dupeguru  [On <strong>Gentoo Linux</strong>]
$ sudo apk add dupeguru             [On <strong>Alpine Linux</strong>]
$ sudo pacman -S dupeguru           [On <strong>Arch Linux</strong>]
$ sudo zypper install dupeguru      [On <strong>OpenSUSE</strong>]    
```

<div class="entry-content" id="bkmrk-dupeguru-%E2%80%93-find-dupl" itemprop="text"><figure aria-describedby="caption-attachment-35495" class="wp-caption aligncenter" id="bkmrk-dupeguru-%E2%80%93-find-dupl-1">![DupeGuru - Find Duplicate Files in Linux](https://www.tecmint.com/wp-content/uploads/2018/11/DupeGuru-Find-Duplicate-Files-in-Linux.png)<figcaption class="wp-caption-text" id="bkmrk-dupeguru-%E2%80%93-find-dupl-2">DupeGuru – Find Duplicate Files in Linux</figcaption></figure></div>## 5. FSlint – Duplicate File Finder for Linux

**[FSlint](https://www.tecmint.com/fslint-find-and-remove-duplicate-unwanted-files-in-linux/)** is a free utility that is used to find and clean various forms of lint on a filesystem. It also reports duplicate files, empty directories, temporary files, duplicate/conflicting (binary) names, bad symbolic links, and many more. It has both command-line and GUI modes.

However, it’s important to note that as of my knowledge cutoff in September 2022, **FSlint** was last updated in 2013 and may not be actively maintained or compatible with newer Linux distributions.

### Install FSlint on Linux

To install **FSlint** in Linux, use the following command as per your Linux distribution.

```
$ sudo apt install fslint         [On <strong>Debian, Ubuntu and Mint</strong>]
$ sudo yum install fslint         [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>]
$ sudo emerge -a sys-apps/fslint  [On <strong>Gentoo Linux</strong>]
$ sudo apk add fslint             [On <strong>Alpine Linux</strong>]
$ sudo pacman -S fslint           [On <strong>Arch Linux</strong>]
$ sudo zypper install fslint      [On <strong>OpenSUSE</strong>]    
```

<div class="entry-content" id="bkmrk-fslint-%E2%80%93-duplicate-f" itemprop="text"><figure aria-describedby="caption-attachment-35497" class="wp-caption aligncenter" id="bkmrk-fslint-%E2%80%93-duplicate-f-1">![FSlint - Duplicate File Finder for -Linux](https://www.tecmint.com/wp-content/uploads/2018/11/FSlint-Duplicate-File-Finder-for-Linux.png)<figcaption class="wp-caption-text" id="bkmrk-fslint-%E2%80%93-duplicate-f-2">FSlint – Duplicate File Finder for -Linux</figcaption></figure></div>##### Conclusion

These are very useful tools to find duplicated files on your Linux system, but you should be very careful when deleting such files.

If you are unsure if you need a file or not, it would be better to create a backup of that file and remember its directory prior to deleting it. If you have any questions or comments, please submit them in the comment section below.