This manual page documents hardlink, a program which consolidates duplicate files in one or more directories using hardlinks.
hardlink traverses one or more directories searching for duplicate files. When it finds duplicate files, it uses one of them as the master. It then removes all other duplicates and places a hardlink for each one pointing to the master file. This allows for conservation of disk space where multiple directories on a single filesystem contain many duplicate files.
The optional pattern for excluding files and directories must be a PCRE2 compatible regular expression. Only the basename of the file or directory is checked, not its path. Excluded directories' contents will not be examined.
Man page written by Brian Long and later updated by Jindrich Novy <email@example.com>
hardlink assumes that its target directory trees do not change from under it. If a directory tree does change, this may result in hardlink accessing files and/or directories outside of the intended directory tree. Thus, you must avoid running hardlink on potentially changing directory trees, and especially on directory trees under control of another user.
Historically hardlink silently excluded any names beginning with
".in.", as well as any names beginning with "." followed by exactly 6
other characters. That prior behavior can be achieved by specifying