util-linux/misc-utils/hardlink.1

64 lines
2.6 KiB
Groff
Raw Normal View History

2005-11-07 08:07:33 -06:00
.TH "hardlink" "1"
.SH "NAME"
hardlink \- Consolidate duplicate files via hardlinks
.SH "SYNOPSIS"
.PP
2017-03-28 14:16:56 -05:00
\fBhardlink\fP [\fB-c\fP] [\fB-n\fP] [\fB-v\fP] [\fB-vv\fP] [\fB-x pattern\fP] [\fB-h\fP] directory1 [ directory2 ... ]
2005-11-07 08:07:33 -06:00
.SH "DESCRIPTION"
.PP
This manual page documents \fBhardlink\fP, a
2005-11-07 08:07:33 -06:00
program which consolidates duplicate files in one or more directories
using hardlinks.
.PP
\fBhardlink\fP 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
Since hard links can only span a single filesystem, \fBhardlink\fP
is only useful when all directories specified are on the same filesystem.
.SH "OPTIONS"
.PP
.IP "\fB-c\fP" 10
Compare only the contents of the files being considered for consolidation.
Disregards permission, ownership and other differences.
2013-04-10 07:47:17 -05:00
.IP "\fB-f\fP" 10
Force hardlinking across file systems.
2005-11-07 08:07:33 -06:00
.IP "\fB-n\fP" 10
Do not perform the consolidation; only print what would be changed.
.IP "\fB-v\fP" 10
Print summary after hardlinking.
.IP "\fB-vv\fP" 10
Print every hardlinked file and bytes saved. Also print summary after hardlinking.
2017-03-28 14:16:56 -05:00
.IP "\fB-x pattern\fP" 10
Exclude files and directories matching pattern from hardlinking.
2005-11-07 08:07:33 -06:00
.IP "\fB-h\fP" 10
Show help.
2017-03-28 14:16:56 -05:00
.PP
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.
2005-11-07 08:07:33 -06:00
.SH "AUTHOR"
.PP
\fBhardlink\fP was written by Jakub Jelinek <jakub@redhat.com>.
2005-11-07 08:07:33 -06:00
.PP
Man page written by Brian Long and later updated by Jindrich Novy <jnovy@redhat.com>
.SH "BUGS"
.PP
\fBhardlink\fP assumes that its target directory trees do not change from under
it. If a directory tree does change, this may result in \fBhardlink\fP
accessing files and/or directories outside of the intended directory tree.
Thus, you must avoid running \fBhardlink\fP on potentially changing directory
trees, and especially on directory trees under control of another user.
2017-03-28 14:16:56 -05:00
.PP
Historically \fBhardlink\fP 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
.br
-x '^(\\.in\\.|\\.[^.]{6}$)'
.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/.