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