Find and Remove File Duplicates in Linux Mint

Today we will see how to find and remove file duplicates in Linux Mint. This is a very commonly required task for anyone who stores a bunch of photos, documents and other files in various locations. Over time, several copies of the same file can accumulate because you don't want to change the originals. Here is how you can find and remove duplicate files.


In Linux, there are several ways to find file duplicates. But the most useful tool is fdupes, a console app. Don't be scared with the command line; it is very easy to use this application. In Linux Mint, you can install it from the default repository, no external PPA or software source is required.

To find and remove file duplicates in Linux Mint, do the following.

  1. Open main menu and go to Administration - Software Manager. Linux Mint Open Software Manager
    Enter your password to continue with Software Manager. Enter Your Password
  2. In Software Manager, type fdupes in the search box and press the Enter key: Software Manager Locate Fdupes App Click the fdupes search result and install it. Install Fdupes In Linux Mint
  3. Now, go to the folder where you want to find duplicates in. Open Terminal in that folder. Open Target Folder In Terminal Folder Opened In Terminal
  4. To find file duplicates, type the command
    fdupes -r ./

    The -r switch tells the app to go through subdirectories. The ./ portion makes the app find duplicates in the current folder.
    So, the whole command means "find file duplicates in the current directory and its subdirectories".
    In the output, you will see all file duplicates: File Dublicates Found

  5. To find and delete file duplicates, type the following command:
    fdupes -r -d ./

    The additional switch -d tells the app to ask the user which files he wants to retain on the drive and which files should be removed. This is how it looks in action: Linux Mint Find And Remove File Dublicates

    For each set of file duplicates, the app shows a list of files and asks which file to keep.

Fdupes is a reliable and easy to use application which allows you to keep your files organized and recovers valuable drive space. It supports a number of other options which you can find in its manual page. In the terminal app, you can type the command man fdupes to learn about them.
These are worth mentioning:
-S --size - use this switch to print out the size of duplicate files. Fdupes Show File Sizes
-s --symlinks - follow symlinked directories
-H --hardlinks - normally, when two or more files point to the same disk area, they are treated as non-duplicates. This option will change this behavior.
-m --summarize - summarize duplicate file information. Fdupes Summarize File Duplicates Information

That's it.

3 thoughts on “Find and Remove File Duplicates in Linux Mint

  1. Jozsef

    Thank you for this and other articles on Linux. I have Mint installed but actually switching over completely from Windows is easy to postpone one day at a time because of the countless routine things I need to research before I can do everything I’m used to doing. Your help is greatly appreciated.

    I’ve turned off ad blocking even though some of your ads don’t make me happy. ;) It’s the least I can do.

    Like or Dislike: Thumb up 0 Thumb down 1

    Reply
    1. Sergey Tkachenko Post author

      Thank you Jozsef
      I really appreciate your move.
      Btw, you can ask me any question regarding Linux here in the comments or via email. I will try to be of help.

      Like or Dislike: Thumb up 0 Thumb down 0

      Reply
  2. Barrykey

    I am using Duplicate Files Deleter its a simple way to keep my computer clean.

    Like or Dislike: Thumb up 0 Thumb down 0

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *