• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Find & Delete Duplicate Files On Ubuntu Linux

How To Find & Delete Duplicate Files On Ubuntu Linux

By Sourabh / December 7, 2017 Category: How To, Ubuntu

On Linux, find duplicate files in different directories or on Linux, fine duplicate files by name or content. How to find files with same name on Linux Ubuntu, using fdupes. Fdupes is a command line tool to find duplicate files using Command Line on Linux Systems.

Install fdupes

fdupes finds duplicate files in a given set of directories. It searches the given path for duplicate files. Such files are found by comparing file sizes and MD5 signatures, followed by a byte-by-byte comparison.

Run the following commands to install fdupes on Ubuntu Systems:

$ sudo apt-get install fdupes

How to use fdupes?

fdupes-ubuntu

Using fdupes is easy and simple. Simplye execute the fdupes command followed by the path to a directory that you wish to search in for duplicate files.

For finding duplicates, you have execute the command $ fdupes /path/to/some/directory This command will only look in directory specified and will print out all the duplicate files. It will not look into sub-directories. To look also in sub-directories, add the “-r” command option. It denotes “recursively” and will force the command to look for duplicate files in all the sub-directories.

Examples of using fdupes

So to find duplicate files in Downloads directory, run the command fdupes /home/sourcedigit/Downloads [replace sourcedigit with yours). It will list all duplicate files in the directory Downloads. Note that the above command will not look for duplicate files in subdirectories. To find all the duplicate files in subdirectories, run the command with option -r. It will recursively search all subdirectories inside /Downloads directory for duplicate files and accordingly list them on the screen.

Deleting Duplicate Files

Please note that the fdupes command do not automatically delete any files. To delete the duplicate files use -d –delete. It will prompt user for files to preserve, deleting all others. So if you want to delete all the duplicate files, run the command $ fdupes -d /path/to/directory.

Command Options

There are many command options that can be used with fdupes. For example, to see the the size of files use the option -S. Use -m –summarize to get a summary of the duplicate files information.

PLEASE NOTE

When using -d or –delete, care should be taken to insure against accidental data loss.
When used together with options -s or –symlink, a user could accidentally preserve a symlink while deleting the file it points to.

Popular command options to use:

  • -r –recurse
    for every directory given follow subdirectories encountered within
  • -R –recurse:
    for each directory given after this option follow subdirectories encountered within (note the ‘:’ at the end of option)
  • -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
  • -n –noempty
    exclude zero-length files from consideration
  • -f –omitfirst
    omit the first file in each set of matches
  • -A –nohidden
    exclude hidden files from consideration
  • -1 –sameline
    list each set of matches on a single line
  • -S –size
    show size of duplicate files
  • -m –summarize
    summarize duplicate files information
  • -q –quiet
    hide progress indicator
  • -d –delete
    prompt user for files to preserve, deleting all others.
  • -N –noprompt
    when used together with –delete, preserve the first file in each set of duplicates and delete the others without promptingthe user
  • -v –version
    display fdupes version
  • -h –help
    displays help

Tags: Dupeguru Linux, Fdupes Linux, Fdupes Ubuntu, Find Duplicate Files Command Line Windows, Find Duplicate Files on Debian, Find Duplicate Files on Linux, Find Duplicate Files on Ubuntu, Find Files With Same Name Linux, Fslint, How to Find Duplicate Files on Debian, How to Find Duplicate Files on Linux, How to Find Duplicate Files on Ubuntu, How to Remove Duplicate Files on Debian, How to Remove Duplicate Files on Linux, How to Remove Duplicate Files on Ubuntu, How to Search Duplicate Files on Debian, How to Search Duplicate Files on Linux, How to Search Duplicate Files on Ubuntu, Linux Fdupes, Linux Find Duplicate Files By Content, Linux Find Duplicate Files By Name, Linux Find Duplicate Files In Different Directories, Remove Duplicate Files on Debian, Remove Duplicate Files on Linux, Remove Duplicate Files on Ubuntu, Search Duplicate Files on Debian, Search Duplicate Files on Linux, Search Duplicate Files on Ubuntu, Ubuntu Fdupes

Primary Sidebar

Latest Posts

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

© 2025 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap