]>
Commit | Line | Data |
---|---|---|
cabf1c1c JN |
1 | .TH "hardlink" "1" |
2 | .SH "NAME" | |
3 | hardlink \- Consolidate duplicate files via hardlinks | |
4 | .SH "SYNOPSIS" | |
98542119 KZ |
5 | .B hardlink |
6 | [options] | |
7 | .RI [ directory ...] | |
cabf1c1c JN |
8 | .SH "DESCRIPTION" |
9 | .PP | |
f7c5507d | 10 | This manual page documents \fBhardlink\fR, a |
cabf1c1c JN |
11 | program which consolidates duplicate files in one or more directories |
12 | using hardlinks. | |
13 | .PP | |
f7c5507d | 14 | \fBhardlink\fR traverses one |
cabf1c1c JN |
15 | or more directories searching for duplicate files. When it finds duplicate |
16 | files, it uses one of them as the master. It then removes all other | |
17 | duplicates and places a hardlink for each one pointing to the master file. | |
18 | This allows for conservation of disk space where multiple directories | |
19 | on a single filesystem contain many duplicate files. | |
20 | .PP | |
f7c5507d | 21 | Since hard links can only span a single filesystem, \fBhardlink\fR |
cabf1c1c JN |
22 | is only useful when all directories specified are on the same filesystem. |
23 | .SH "OPTIONS" | |
98542119 KZ |
24 | .TP |
25 | .BR \-c , " \-\-content" | |
cabf1c1c JN |
26 | Compare only the contents of the files being considered for consolidation. |
27 | Disregards permission, ownership and other differences. | |
98542119 KZ |
28 | .TP |
29 | .BR \-f , " \-\-force" | |
348af99a | 30 | Force hardlinking across file systems. |
98542119 KZ |
31 | .TP |
32 | .BR \-n , " \-\-dry\-run" | |
cabf1c1c | 33 | Do not perform the consolidation; only print what would be changed. |
98542119 KZ |
34 | .TP |
35 | .BR \-v , " \-\-verbose" | |
36 | Print summary after hardlinking. The option may be specified more than once. In | |
f7c5507d | 37 | this case (e.g. \fB-vv\fR) it prints every hardlinked file and bytes saved. |
98542119 | 38 | .TP |
f7c5507d | 39 | .BR \-x , " \-\-exclude " \fIregex\fR |
551e8963 | 40 | Exclude files and directories matching pattern from hardlinking. |
98542119 | 41 | .sp |
551e8963 TL |
42 | The optional pattern for excluding files and directories must be a PCRE2 |
43 | compatible regular expression. Only the basename of the file or directory | |
44 | is checked, not its path. Excluded directories' contents will not be examined. | |
98542119 KZ |
45 | .TP |
46 | .BR \-h , " \-\-help" | |
47 | Display help text and exit. | |
48 | .TP | |
49 | .BR \-V , " \-\-version" | |
50 | Display version information and exit. | |
cabf1c1c JN |
51 | .SH "AUTHOR" |
52 | .PP | |
f7c5507d | 53 | \fBhardlink\fR was written by Jakub Jelinek <jakub@redhat.com> and later modified by |
98542119 | 54 | Ruediger Meier <ruediger.meier@ga-group.nl> and Karel Zak <kzak@redhat.com> for util-linux. |
cabf1c1c | 55 | .PP |
bd9a35c6 | 56 | Man page written by Brian Long and later updated by Jindrich Novy <jnovy@redhat.com> |
94b040b0 JN |
57 | .SH "BUGS" |
58 | .PP | |
f7c5507d KZ |
59 | \fBhardlink\fR assumes that its target directory trees do not change from under |
60 | it. If a directory tree does change, this may result in \fBhardlink\fR | |
94b040b0 | 61 | accessing files and/or directories outside of the intended directory tree. |
f7c5507d | 62 | Thus, you must avoid running \fBhardlink\fR on potentially changing directory |
94b040b0 | 63 | trees, and especially on directory trees under control of another user. |
551e8963 | 64 | .PP |
f7c5507d | 65 | Historically \fBhardlink\fR silently excluded any names beginning with |
551e8963 TL |
66 | ".in.", as well as any names beginning with "." followed by exactly 6 |
67 | other characters. That prior behavior can be achieved by specifying | |
68 | .br | |
5aad3c12 | 69 | -x '^(\\.in\\.|\\.[^.]{6}$)' |
bd9a35c6 KZ |
70 | .SH AVAILABILITY |
71 | The hardlink command is part of the util-linux package and is available from | |
72 | https://www.kernel.org/pub/linux/utils/util-linux/. |