2005-11-07 08:07:33 -06:00
|
|
|
.TH "hardlink" "1"
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH NAME
|
2005-11-07 08:07:33 -06:00
|
|
|
hardlink \- Consolidate duplicate files via hardlinks
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH SYNOPSIS
|
2019-02-11 07:01:55 -06:00
|
|
|
.B hardlink
|
|
|
|
[options]
|
|
|
|
.RI [ directory ...]
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH DESCRIPTION
|
2019-05-31 04:50:40 -05:00
|
|
|
This manual page documents \fBhardlink\fR, a
|
2005-11-07 08:07:33 -06:00
|
|
|
program which consolidates duplicate files in one or more directories
|
|
|
|
using hardlinks.
|
|
|
|
.PP
|
2019-05-31 04:50:40 -05:00
|
|
|
\fBhardlink\fR traverses one
|
2005-11-07 08:07:33 -06:00
|
|
|
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.
|
|
|
|
.PP
|
2019-05-31 04:50:40 -05:00
|
|
|
Since hard links can only span a single filesystem, \fBhardlink\fR
|
2005-11-07 08:07:33 -06:00
|
|
|
is only useful when all directories specified are on the same filesystem.
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH OPTIONS
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
|
|
|
.BR \-c , " \-\-content"
|
2005-11-07 08:07:33 -06:00
|
|
|
Compare only the contents of the files being considered for consolidation.
|
|
|
|
Disregards permission, ownership and other differences.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
|
|
|
.BR \-f , " \-\-force"
|
2013-04-10 07:47:17 -05:00
|
|
|
Force hardlinking across file systems.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
|
|
|
.BR \-n , " \-\-dry\-run"
|
2005-11-07 08:07:33 -06:00
|
|
|
Do not perform the consolidation; only print what would be changed.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
|
|
|
.BR \-v , " \-\-verbose"
|
|
|
|
Print summary after hardlinking. The option may be specified more than once. In
|
2019-12-15 18:51:57 -06:00
|
|
|
this case (e.g., \fB\-vv\fR) it prints every hardlinked file and bytes saved.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
2019-05-31 04:50:40 -05:00
|
|
|
.BR \-x , " \-\-exclude " \fIregex\fR
|
2017-03-28 14:16:56 -05:00
|
|
|
Exclude files and directories matching pattern from hardlinking.
|
2019-02-11 07:01:55 -06:00
|
|
|
.sp
|
2017-03-28 14:16:56 -05:00
|
|
|
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.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
|
|
|
.BR \-h , " \-\-help"
|
|
|
|
Display help text and exit.
|
|
|
|
.TP
|
|
|
|
.BR \-V , " \-\-version"
|
|
|
|
Display version information and exit.
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH BUGS
|
2019-05-31 04:50:40 -05:00
|
|
|
\fBhardlink\fR assumes that its target directory trees do not change from under
|
|
|
|
it. If a directory tree does change, this may result in \fBhardlink\fR
|
2011-10-20 19:49:08 -05:00
|
|
|
accessing files and/or directories outside of the intended directory tree.
|
2019-05-31 04:50:40 -05:00
|
|
|
Thus, you must avoid running \fBhardlink\fR on potentially changing directory
|
2011-10-20 19:49:08 -05:00
|
|
|
trees, and especially on directory trees under control of another user.
|
2017-03-28 14:16:56 -05:00
|
|
|
.PP
|
2019-05-31 04:50:40 -05:00
|
|
|
Historically \fBhardlink\fR silently excluded any names beginning with
|
2017-03-28 14:16:56 -05:00
|
|
|
".in.", as well as any names beginning with "." followed by exactly 6
|
|
|
|
other characters. That prior behavior can be achieved by specifying
|
|
|
|
.br
|
2019-12-15 18:51:57 -06:00
|
|
|
\-x '^(\\.in\\.|\\.[^.]{6}$)'
|
2020-05-21 02:28:21 -05:00
|
|
|
.SH AUTHORS
|
|
|
|
\fBhardlink\fR was written by Jakub Jelinek <jakub@redhat.com> and later modified by
|
|
|
|
Ruediger Meier <ruediger.meier@ga-group.nl> and Karel Zak <kzak@redhat.com> for util-linux.
|
|
|
|
.PP
|
|
|
|
Man page written by Brian Long and later updated by Jindrich Novy <jnovy@redhat.com>
|
2019-02-06 07:37:34 -06:00
|
|
|
.SH AVAILABILITY
|
|
|
|
The hardlink command is part of the util-linux package and is available from
|
|
|
|
https://www.kernel.org/pub/linux/utils/util-linux/.
|