OSDN Git Service

bdbb18c733c40bd384ba4024803499b6fed44b9c
[linuxjm/jm.git] / manual / util-linux / original / man1 / hardlink.1
1 '\" t
2 .\"     Title: hardlink
3 .\"    Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.15
5 .\"      Date: 2022-02-14
6 .\"    Manual: User Commands
7 .\"    Source: util-linux 2.37.4
8 .\"  Language: English
9 .\"
10 .TH "HARDLINK" "1" "2022-02-14" "util\-linux 2.37.4" "User Commands"
11 .ie \n(.g .ds Aq \(aq
12 .el       .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 .  mso www.tmac
22 .  am URL
23 .    ad l
24 .  .
25 .  am MTO
26 .    ad l
27 .  .
28 .  LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 hardlink \- link multiple copies of a file
32 .SH "SYNOPSIS"
33 .sp
34 \fBhardlink\fP [options] [\fIdirectory\fP|\fIfile\fP]...
35 .SH "DESCRIPTION"
36 .sp
37 \fBhardlink\fP is a tool which replaces copies of a file with hardlinks, therefore saving space.
38 .SH "OPTIONS"
39 .sp
40 \fB\-h\fP, \fB\-\-help\fP
41 .RS 4
42 print quick usage details to the screen.
43 .RE
44 .sp
45 \fB\-v\fP, \fB\-\-verbose\fP
46 .RS 4
47 More verbose output. If specified once, every hardlinked file is displayed, if specified twice, it also shows every comparison.
48 .RE
49 .sp
50 \fB\-q\fP, \fB\-\-quiet\fP
51 .RS 4
52 Quiet mode, don\(cqt print anything.
53 .RE
54 .sp
55 \fB\-n\fP, \fB\-\-dry\-run\fP
56 .RS 4
57 Do not act, just print what would happen.
58 .RE
59 .sp
60 \fB\-f\fP, \fB\-\-respect\-name\fP
61 .RS 4
62 Only try to link files with the same (basename). It\(cqs strongly recommended to use long options rather than \fB\-f\fP which is interpreted in a different way by others \fBhardlink\fP implementations.
63 .RE
64 .sp
65 \fB\-p\fP, \fB\-\-ignore\-mode\fP
66 .RS 4
67 Link/compare files even if their mode is different. This may be a bit unpredictable.
68 .RE
69 .sp
70 \fB\-o\fP, \fB\-\-ignore\-owner\fP
71 .RS 4
72 Link/compare files even if their owner (user and group) is different. It is not predictable.
73 .RE
74 .sp
75 \fB\-t\fP, \fB\-\-ignore\-time\fP
76 .RS 4
77 Link/compare files even if their time of modification is different. You almost always want this.
78 .RE
79 .sp
80 \fB\-X\fP, \fB\-\-respect\-xattrs\fP
81 .RS 4
82 Only try to link files with the same extended attributes.
83 .RE
84 .sp
85 \fB\-m\fP, \fB\-\-maximize\fP
86 .RS 4
87 Among equal files, keep the file with the highest link count.
88 .RE
89 .sp
90 \fB\-M\fP, \fB\-\-minimize\fP
91 .RS 4
92 Among equal files, keep the file with the lowest link count.
93 .RE
94 .sp
95 \fB\-O\fP, \fB\-\-keep\-oldest\fP
96 .RS 4
97 Among equal files, keep the oldest file (least recent modification time). By default, the newest file is kept. If \fB\-\-maximize\fP or \fB\-\-minimize\fP is specified, the link count has a higher precedence than the time of modification.
98 .RE
99 .sp
100 \fB\-x\fP, \fB\-\-exclude\fP \fIregex\fP
101 .RS 4
102 A regular expression which excludes files from being compared and linked.
103 .RE
104 .sp
105 \fB\-i\fP, \fB\-\-include\fP \fIregex\fP
106 .RS 4
107 A regular expression to include files. If the option \fB\-\-exclude\fP has been given, this option re\-includes files which would otherwise be excluded. If the option is used without \fB\-\-exclude\fP, only files matched by the pattern are included.
108 .RE
109 .sp
110 \fB\-s\fP, \fB\-\-minimum\-size\fP \fIsize\fP
111 .RS 4
112 The minimum size to consider. By default this is 1, so empty files will not be linked. The \fIsize\fP argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB").
113 .RE
114 .SH "ARGUMENTS"
115 .sp
116 \fBhardlink\fP takes one or more directories which will be searched for files to be linked.
117 .SH "BUGS"
118 .sp
119 The original \fBhardlink\fP implementation uses the option \fB\-f\fP to force hardlinks creation between filesystem. This very rarely usable feature is no more supported by the current hardlink.
120 .sp
121 \fBhardlink\fP assumes that the trees it operates on do not change during operation. If a tree does change, the result is undefined and potentially dangerous. For example, if a regular file is replaced by a device, hardlink may start reading from the device. If a component of a path is replaced by a symbolic link or file permissions change, security may be compromised. Do not run hardlink on a changing tree or on a tree controlled by another user.
122 .SH "AUTHOR"
123 .sp
124 There are multiple \fBhardlink\fP implementations. The very first implementation is from Jakub Jelinek for Fedora distribution, this implementation has been used in util\-linux between versions v2.34 to v2.36. The current implementations is based on Debian version from Julian Andres Klode.
125 .SH "REPORTING BUGS"
126 .sp
127 For bug reports, use the issue tracker at \c
128 .URL "https://github.com/karelzak/util\-linux/issues" "" "."
129 .SH "AVAILABILITY"
130 .sp
131 The \fBhardlink\fP command is part of the util\-linux package which can be downloaded from \c
132 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."