Forrest logo
back to the rdfind tool

rdfind:tldr:13a84

rdfind: Replace all duplicates with hardlinks.
$ rdfind -makehardlinks true ${path-to-directory}
try on your machine

The command "rdfind -makehardlinks true ${path-to-directory}" is used to find and remove duplicate files within a directory and its subdirectories, replacing the duplicate files with hardlinks to a single copy of each file.

Let's break down the command and its components:

  1. "rdfind": This is the command itself. It stands for "Remove Duplicate Files" and is a utility used for finding and managing duplicate files.

  2. "-makehardlinks true": This option specifies that rdfind should replace the duplicate files with hardlinks instead of deleting them. A hardlink is a link to the same physical file on disk, allowing multiple filenames to reference the same data. By using hardlinks, the duplicate files are effectively consolidated into a single copy, saving storage space.

  3. "${path-to-directory}": This is the placeholder for the actual directory path you want to scan for duplicate files. You need to replace "${path-to-directory}" with the specific path to the directory you want to search for duplicates in. For example, if you want to search in the "Documents" folder, the command would be "rdfind -makehardlinks true /path/to/Documents".

By running this command, rdfind will recursively scan the specified directory and its subdirectories, identifying and replacing duplicate files with hardlinks.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the rdfind tool