fdupes – find & replace duplicate files with hardlinks


If you do not know how hardlink works, do not follow this tutorial.

We use this method when duplicate files are kind of “read-only”. Because if you replace 2 duplicate files with hardlink pointing to common storage, editing one will change others content. If this is fine, then you can go ahead.

Don’t worry about deletion. Deleting one file won’t delete other file.

Install fdupes 1.51

Ubutnu 12.04 has repo has older version. So follow this:

git clone https://github.com/tobiasschulz/fdupes
cd fdupes
make fdupes
su root
make install


Find duplicate files…

fdupes -r /path/to/dir

Find duplicate files and replace with hardlinks

fdupes -rL /path/to/dir

Note -L option which is responsible for replacing duplicate with hardlinks.

Discuss your project
with our experts

No obligation. Limited slots.

Contact Form Business Enquiry

"*" indicates required fields

Please attach any RFP, project specification, or document that you would like to share.
Drop files here or
Max. file size: 5 GB.
    This field is for validation purposes and should be left unchanged.