hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.\" Copyright (C) 2008 - 2012 Julian Andres Klode. See hardlink.c for license.
|
|
|
|
.\" SPDX-License-Identifier: MIT
|
|
|
|
.TH hardlink 1 "2012-09-17" "0.3"
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH NAME
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
hardlink \- Link multiple copies of a file
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH SYNOPSIS
|
2019-02-11 07:01:55 -06:00
|
|
|
.B hardlink
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.RI [ option ]...
|
|
|
|
.RI [ directory | file ]...
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH DESCRIPTION
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B hardlink
|
|
|
|
is a tool which replaces copies of a file with hardlinks, therefore saving
|
|
|
|
space.
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH OPTIONS
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B \-h or \-\-help
|
|
|
|
print quick usage details to the screen.
|
|
|
|
.TP
|
|
|
|
.B \-v or \-\-verbose
|
|
|
|
More verbose output. If specified once, every hardlinked file is displayed,
|
|
|
|
if specified twice, it also shows every comparison.
|
|
|
|
.TP
|
|
|
|
.B \-n or \-\-dry\-run
|
|
|
|
Do not act, just print what would happen
|
|
|
|
.TP
|
|
|
|
.B \-f or \-\-respect\-name
|
|
|
|
Only try to link files with the same (basename).
|
|
|
|
.TP
|
|
|
|
.B \-p or \-\-ignore\-mode
|
|
|
|
Link/compare files even if their mode is different. This may be a bit unpredictable.
|
|
|
|
.TP
|
|
|
|
.B \-o or \-\-ignore\-owner
|
|
|
|
Link/compare files even if their owner (user and group) is different. It is not
|
|
|
|
predictable
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B \-t or \-\-ignore\-time
|
|
|
|
Link/compare files even if their time of modification is different. You almost
|
|
|
|
always want this.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B \-X or \-\-respect\-xattrs
|
|
|
|
Only try to link files with the same extended attributes.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B \-m or \-\-maximize
|
|
|
|
Among equal files, keep the file with the highest link count.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B \-M or \-\-minimize
|
|
|
|
Among equal files, keep the file with the lowest link count.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B \-O or \-\-keep\-oldest
|
|
|
|
Among equal files, keep the oldest file (least recent modification time). By
|
|
|
|
default, the newest file is kept. If \-\-maximize or \-\-minimize is specified,
|
|
|
|
the link count has a higher precedence than the time of modification.
|
2019-02-11 07:01:55 -06:00
|
|
|
.TP
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B \-x or \-\-exclude
|
|
|
|
A regular expression which excludes files from being compared and linked.
|
|
|
|
.TP
|
|
|
|
.B \-i or \-\-include
|
|
|
|
A regular expression to include files. If the option \-\-exclude has been given,
|
|
|
|
this option re-includes files which would otherwise be excluded. If the option
|
|
|
|
is used without \-\-exclude, only files matched by the pattern are included.
|
|
|
|
.TP
|
|
|
|
.B \-s or \-\-minimum\-size
|
|
|
|
The minimum size to consider. By default this is 1, so empty files will not
|
|
|
|
be linked. An optional suffix of K,M,G,T may be provided, indicating that the
|
|
|
|
file size is KiB,MiB,GiB,TiB.
|
|
|
|
|
|
|
|
.SH ARGUMENTS
|
|
|
|
.B hardlink
|
|
|
|
takes one or more directories which will be searched for files to be linked.
|
|
|
|
|
2020-05-19 03:31:19 -05:00
|
|
|
.SH BUGS
|
hardlink: replace with code from Debian
The current version used in util-linux is based on original code from
Jakub Jelinek.
The new version is based on Debian implementation from
https://salsa.debian.org/jak/hardlink. This new version uses nftw()
to walk on directories tree and organize internal data binary tree
(tsearch() and twalk()). This new version provides more features like
--ignore-{mode,owner,time}, --respect-xattrs, --respect-name,
--include, --keep-oldest, --minimize, --maximize, etc.
Note that the new version uses -f for --respect-name, the old version
uses -f to hardlinking across filesystems (very probably rarely unused
feature).
Addresses: https://github.com/karelzak/util-linux/issues/808
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-04 03:42:53 -06:00
|
|
|
.B hardlink
|
|
|
|
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.
|
|
|
|
|
|
|
|
.B hardlink
|
|
|
|
, as of version 0.3 RC1, improperly calculates the amount of space saved if the
|
|
|
|
option \-\-respect\-name is specified. In previous versions, the amount was
|
|
|
|
wrong in almost all other cases as well.
|
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
The program hardlink and this manpage have been written by Julian Andres Klode,
|
|
|
|
and are licensed under the MIT license. See the code of hardlink for further
|
|
|
|
information.
|