Skip to content

Commit 27dd83b

Browse files
committed
Merge branch 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work
* 'PR/Benno-23May' of https://github.com/karelzak/util-linux-work: hardlink: (man,usage) sort the options mostly alphabetically hardlink: (usage) improve the descriptions of three options hardlink: (usage) remove mistaken period from two option descriptions hexdump: (man) put a list item on a single line, to avoid a warning
2 parents ef878cb + 18c7a2a commit 27dd83b

File tree

3 files changed

+44
-45
lines changed

3 files changed

+44
-45
lines changed

misc-utils/hardlink.1.adoc

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ For example, *hardlink foo/ bar/* will link files in bar/ to equal files in the
6565
*-i*, *--include* _regex_::
6666
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.
6767

68+
*-l*, *--list-duplicates*::
69+
Don't link anything, but list the absolute path of every duplicate file, one per line, preceded by a unique 16-byte discriminator and a tab.
70+
6871
*-m*, *--maximize*::
6972
Among equal files, keep the file with the highest link count.
7073

7174
*-M*, *--minimize*::
7275
Among equal files, keep the file with the lowest link count.
7376

77+
*--mount*::
78+
Do not traverse directories on different filesystems (remain within the same filesystem).
79+
7480
*-n*, *--dry-run*::
7581
Do not act, just print what would happen.
7682

77-
*-l*, *--list-duplicates*::
78-
Don't link anything, but list the absolute path of every duplicate file, one per line, preceded by a unique 16-byte discriminator and a tab.
79-
80-
*-z*, *--zero*::
81-
Separate lines with a NUL instead of a newline in *-l* mode.
82-
8383
*-o*, *--ignore-owner*::
8484
Link and compare files even if their owner information (user and group) differs. Results may be unpredictable.
8585

@@ -98,6 +98,22 @@ file content block (see *--io-size*), these checksums are cached for the next co
9898
size is important for large files or a large sets of files of the same size. The default is
9999
10MiB.
100100

101+
*--reflink*[**=**_when_]::
102+
Create copy-on-write clones (aka reflinks) rather than hardlinks. The reflinked files
103+
share only on-disk data, but the file mode and owner can be different. It's recommended
104+
to use this option together with the *--ignore-owner* and *--ignore-mode* options.
105+
This option implies *--skip-reflinks* to ignore already cloned files.
106+
+
107+
The optional argument _when_ can be *never*, *always*, or *auto*. If the _when_ argument
108+
is omitted, it defaults to *auto*, which means that *hardlink* checks the filesystem type
109+
and uses reflinks on BTRFS and XFS only, and falls back to hardlinks when creating a
110+
reflink is impossible.
111+
The argument *always* disables filesystem-type detection and the fallback to hardlinks,
112+
which means that only reflinks are allowed.
113+
114+
*--skip-reflinks*::
115+
Ignore already cloned files. This option may be used without *--reflink* when creating classic hardlinks.
116+
101117
*-s*, *--minimum-size* _size_::
102118
The minimum size to consider. By default this is 1, so empty files will not be linked. The _size_ 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").
103119

@@ -116,33 +132,18 @@ A regular expression that excludes files from being compared and linked. This op
116132
*--exclude-subtree* _regex_::
117133
A regular expression that excludes entire directories from being compared and linked. This option can also be used multiple times.
118134

119-
*--mount*::
120-
Do not traverse directories on different filesystems (remain within the same filesystem).
121-
122135
*-X*, *--respect-xattrs*::
123136
Only try to link files with the same extended attributes.
124137

125138
*-y*, *--method* _name_::
126139
Set the file content comparison method. The currently supported methods are
127-
sha256, sha1, crc32c and memcmp. The default is sha256, or memcmp if Linux
128-
Crypto API is not available. The methods based on checksums are implemented in
129-
zero-copy way, in this case file contents are not copied to the userspace and all
130-
calculation is done in kernel.
131-
132-
*--reflink*[**=**_when_]::
133-
Create copy-on-write clones (aka reflinks) rather than hardlinks. The reflinked files
134-
share only on-disk data, but the file mode and owner can be different. It's recommended
135-
to use it with *--ignore-owner* and *--ignore-mode* options. This option implies
136-
*--skip-reflinks* to ignore already cloned files.
137-
+
138-
The optional argument _when_ can be *never*, *always*, or *auto*. If the _when_ argument
139-
is omitted, it defaults to *auto*, in this case, *hardlink* checks filesystem type and
140-
uses reflinks on BTRFS and XFS only, and fallback to hardlinks when creating reflink is impossible.
141-
The argument *always* disables filesystem type detection and fallback to hardlinks, in this case,
142-
only reflinks are allowed.
140+
*sha256*, *sha1*, *crc32c*, and *memcmp*. The default is *sha256*, or *memcmp* if the
141+
Linux Crypto API is not available. The methods based on checksums are implemented in
142+
a zero-copy way, which means that file contents are not copied to userspace and all
143+
calculation is done in the kernel.
143144

144-
*--skip-reflinks*::
145-
Ignore already cloned files. This option may be used without *--reflink* when creating classic hardlinks.
145+
*-z*, *--zero*::
146+
Separate lines with a NUL byte instead of a newline (for *-l*).
146147

147148
include::man-common/help-version.adoc[]
148149

misc-utils/hardlink.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,43 +1191,42 @@ static void __attribute__((__noreturn__)) usage(void)
11911191
fputs(USAGE_OPTIONS, out);
11921192
fputs(_(" -c, --content compare only file contents, same as -pot\n"), out);
11931193
fputs(_(" -b, --io-size <size> I/O buffer size for file reading\n"
1194-
" (speedup, using more RAM)\n"), out);
1194+
" (speedup, using more RAM)\n"), out);
11951195
fputs(_(" -d, --respect-dir directory names have to be identical\n"), out);
11961196
fputs(_(" -f, --respect-name filenames have to be identical\n"), out);
1197+
fputs(_(" -F, --prioritize-trees files found in the earliest specified top-level\n"
1198+
" directory have higher priority (but this has\n"
1199+
" lower precedence than --maximize/--minimize)\n"), out);
11971200
fputs(_(" -i, --include <regex> regular expression to include files/dirs\n"), out);
1198-
fputs(_(" -m, --maximize maximize the hardlink count, remove the file with\n"
1199-
" lowest hardlink count\n"), out);
1200-
fputs(_(" -M, --minimize reverse the meaning of -m\n"), out);
1201+
fputs(_(" -l, --list-duplicates just list paths of duplicates, don't link them\n"), out);
1202+
fputs(_(" -m, --maximize keep the file with the most links\n"), out);
1203+
fputs(_(" -M, --minimize keep the file with the fewest links\n"), out);
1204+
fputs(_(" --mount stay within the same filesystem\n"), out);
12011205
fputs(_(" -n, --dry-run don't actually link anything\n"), out);
1202-
fputs(_(" -l, --list-duplicates print every group of duplicate files\n"), out);
1203-
fputs(_(" -z, --zero delimit output with NULs instead of newlines\n"), out);
12041206
fputs(_(" -o, --ignore-owner ignore owner changes\n"), out);
1205-
fputs(_(" -F, --prioritize-trees files found in the earliest specified top-level\n"
1206-
" directory have higher priority (lower precedence\n"
1207-
" than minimize/maximize)\n"), out);
12081207
fputs(_(" -O, --keep-oldest keep the oldest file of multiple equal files\n"
12091208
" (lower precedence than minimize/maximize)\n"), out);
12101209
fputs(_(" -p, --ignore-mode ignore changes of file mode\n"), out);
12111210
fputs(_(" -q, --quiet quiet mode - don't print anything\n"), out);
12121211
fputs(_(" -r, --cache-size <size> memory limit for cached file content data\n"), out);
1213-
fputs(_(" -s, --minimum-size <size> minimum size for files.\n"), out);
1214-
fputs(_(" -S, --maximum-size <size> maximum size for files.\n"), out);
1212+
#ifdef USE_REFLINK
1213+
fputs(_(" --reflink[=<when>] create clone/CoW copies (auto, always, never)\n"), out);
1214+
fputs(_(" --skip-reflinks skip already cloned files (enabled on --reflink)\n"), out);
1215+
#endif
1216+
fputs(_(" -s, --minimum-size <size> minimum size for files\n"), out);
1217+
fputs(_(" -S, --maximum-size <size> maximum size for files\n"), out);
12151218
fputs(_(" -t, --ignore-time ignore timestamps (when testing for equality)\n"), out);
12161219
fputs(_(" -v, --verbose verbose output (repeat for more verbosity)\n"), out);
12171220
fputs(_(" -x, --exclude <regex> regular expression to exclude files\n"), out);
12181221
#ifdef USE_SKIP_SUBTREE
12191222
fputs(_(" --exclude-subtree <regex> regular expression to exclude directories\n"), out);
12201223
#endif
1221-
fputs(_(" --mount stay within the same filesystem\n"), out);
12221224
#ifdef USE_XATTR
12231225
fputs(_(" -X, --respect-xattrs respect extended attributes\n"), out);
12241226
#endif
12251227
fputs(_(" -y, --method <name> file content comparison method\n"), out);
1228+
fputs(_(" -z, --zero delimit output with NULs instead of newlines\n"), out);
12261229

1227-
#ifdef USE_REFLINK
1228-
fputs(_(" --reflink[=<when>] create clone/CoW copies (auto, always, never)\n"), out);
1229-
fputs(_(" --skip-reflinks skip already cloned files (enabled on --reflink)\n"), out);
1230-
#endif
12311230
fputs(USAGE_SEPARATOR, out);
12321231
fprintf(out, USAGE_HELP_OPTIONS(28));
12331232
fprintf(out, USAGE_MAN_TAIL("hardlink(1)"));

text-utils/hexdump.1.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ The format is required and must be surrounded by double quote (" ") marks. It is
118118
119119
. An asterisk (*) may not be used as a field width or precision.
120120
121-
. A byte count or field precision _is_ required for each *s* conversion character
122-
(unlike the *fprintf*(3) default which prints the entire string if the precision is unspecified).
121+
. A byte count or field precision _is_ required for each *s* conversion character (unlike the *fprintf*(3) default which prints the entire string if the precision is unspecified).
123122
124123
. The conversion characters *h*, *l*, *n*, *p*, and *q* are not supported.
125124

0 commit comments

Comments
 (0)