2223 Commits

Author SHA1 Message Date
Paul Eggert
f3980d7cfa doc: fix date(1) synopses etc
Font problem reported by Michael Aramini via Alejandro Colomar
<https://bugs.gnu.org/80258>.  This patch also fixes some
longstanding confusion with date synopses.
* src/date.c (usage): Do not imply that only -u can be used with
MMDDhhmm..., and do not put misleading brackets around the latter.
2026-01-25 19:08:53 -08:00
Pádraig Brady
87219034b7 doc: use TERM=dumb rather than HELP_NO_MARKUP to disable markup
This is a more standard mechanism to disable markup.

* src/system.h (oputs_): Logic change to honor TERM=dumb,
rather than HELP_NO_MARKUP=something.
* doc/coreutils.texi: Adjust the description for --help.
* man/local.mk: Ensure TERM is set to something,
so that man pages have links included.
* man/viewman: Just honor users $TERM.
* tests/misc/getopt_vs_usage.sh: Remove env var complication,
as TERM is unset automatically.
* tests/misc/usage_vs_refs.sh: Likewise.
* NEWS: Adjust the change in behavior note.
2026-01-22 11:42:47 +00:00
Pádraig Brady
49cabb6845 doc: cp: group related -HLP descriptions
* src/cp (usage): The -HLP options are close
in functionality and close alphabetically, so describe together.
* doc/coreutils.texi (cp invocation): Likewise.
2026-01-21 13:51:58 +00:00
Pádraig Brady
c666aa7461 doc: cp: document --keep-directory-symlink in correct location
* src/cp.c (usage): Move to alphabetically in list.
* doc/coreutils.texi (mv invocation): Move description from here ...
(cp invocation): ... to here.
2026-01-21 13:51:58 +00:00
Pádraig Brady
af61d818f8 doc: ls: document --block-size in the manual
* doc/coreutils.texi (ls invocation): Document --block-size
2026-01-21 13:51:58 +00:00
Pádraig Brady
9a10b354ec doc: who: document --users in manual
* doc/coreutils.texi (who invocation): Mention that --users
is equivalent to -u.
* src/who.c (usage): Mention -u shows idle time.
2026-01-21 13:51:58 +00:00
Pádraig Brady
1d1539a529 doc: id: document -a in manual
* doc/coreutils.texi (id invocation): Mention this option is ignored.
2026-01-21 13:51:58 +00:00
Pádraig Brady
a06f0cf67e doc: more indexing fixes in manual
* doc/coreutils.texi: Add missing anchors.
* src/pr.c (Usage): Adjust to use -COLS, to avoid a clash
with the additional anchor added to the manual.
Also markup the --columns option as done for other options.
* tests/split/line-bytes.sh: Also fix --lines-bytes typo here.
2026-01-21 13:51:58 +00:00
Egmont Koblinger
5de8835672 doc: tty: fix indexing in texinfo
* doc/coreutils.texi: Fix recently introduced typo.
* THANKS.in: Remove as now committed to the repo.
2026-01-21 13:51:58 +00:00
Pádraig Brady
0f5ab6cb8b doc: readlink: improve option ordering in texinfo
* doc/coreutils.texi (readlink invocation): Order -q,-s alphabetically.
2026-01-21 13:51:40 +00:00
Pádraig Brady
d5e15b2f29 doc: ls: support styling and links in --help output
* src/ls.c (oputs): A new function that wraps puts(),
but also highlights the --option-text portion, and
adds links to the appropriate part of the online manual.
(usage): Call oputs() rather than puts().
* doc/coreutils.texi (--help): Document new HELP_NO_MARKUP env var,
which can be used in the edge case one wants to suppress ansi escapes.
* tests/misc/getopt_vs_usage.sh: Use HELP_NO_MARKUP to ensure the
test continues to pass.
2026-01-21 13:51:39 +00:00
Collin Funk
740d33b8da doc: post process html with non-GNU make programs
* .gitignore (/build-aux/makeinfo-wrapper.sh):
* Makefile.am (EXTRA_DIST): Remove build-aux/makeinfo-wrapper.sh.
* build-aux/makeinfo-wrapper.sh.in: New file, renamed from
build-aux/makeinfo-wrapper.sh and modified to use @MAKEINFO@ instead of
makeinfo.
* cfg.mk (MAKEINFO): Remove variable.
* configure.ac: Add build-aux/makeinfo-wrapper.sh as a configure file.
* doc/local.mk (MAKEINFO): Define to
$(abs_top_builddir)/build-aux/makeinfo-wrapper.sh.
(AM_MAKEINFOFLAGS): Move over some values from the previous MAKEINFO
definition.
2026-01-18 12:09:47 -08:00
Pádraig Brady
f7bb91968b doc: add more redirections from legacy *sum to cksum
*  doc/coreutils.texi (md5sum invocation, sha1sum invocation,
b2sum invocation, sha2 utilities): Mention these are legacy interfaces,
and reference 'cksum invocation'.
*  src/cksum.c (usage): Likewise.
*  man/md5sum.x: Redirect to cksum, rather than individual utils.
*  man/sha1sum.x: Likewise.
2026-01-18 14:19:38 +00:00
Pádraig Brady
36d6cb2774 doc: paste: give a CSV generation example
* doc/coreutils.texi (paste invocation): Provide an example
to comma separate data.
2026-01-15 15:54:18 +00:00
Pádraig Brady
9a8b09f025 doc: paste: add more detail on operation and options
* src/paste.c (usage): Mention how lines are processed
with and without the -s option.  Also mention that -d
supports backslash escapes.
* doc/coreutils.texi (paste invocation): Likewise.
Also detail the backslash escapes, noting which are non-POSIX.
2026-01-12 14:13:20 +00:00
Pádraig Brady
5c238fcadd doc: runcon: use more accurate synopsis format
* src/runcon.c (usage): Align synopsis with format
used in other commands.
* doc/coreutils.texi (runcon invocation): Likewise.
2026-01-11 18:43:32 +00:00
Pádraig Brady
a3ae4123f9 doc: tr: warn about shell quoting [:classes:]
* src/tr.c (usage): Warn about avoiding shell globbing.
* doc/coreutils.texi (character arrays): Likewise.
Suggested by Daniel Dallos.
2026-01-06 18:41:00 +00:00
Pádraig Brady
7531d3a205 ptx: implement -t to change default width to 100
Align the -t implementation with the Heirloom project.

* src/ptx.c (usage): Describe -t, and also mention
the default width is 72 when not used.
* doc/coreutils.texi (ptx invocation): Likewise.
(main): Override the default width if -t is specified.
* tests/ptx/ptx.pl: Add test cases.
* NEWS: Mention the change in behavior.
2026-01-05 23:37:49 +00:00
Collin Funk
73d3a49f45 maint: run 'make update-copyright' 2026-01-01 10:56:16 -08:00
Collin Funk
d7aaa001d9 doc: prefer UTF-8 characters in texinfo sources
* doc/coreutils.texi (Introduction): Use ç instead of @,{c}.
(Character arrays): Use ö instead of @"o. Use Ł instead of @L{}.
(Formatting file timestamps): Use ä instead of @"a.
2025-12-20 13:27:07 -08:00
Pádraig Brady
3a07cefae0 doc: ls: fix recent typo for -F option in texinfo
* doc/coreutils.texi (ls invocation): Add a missing hyphen
that was inadvertently dropped in the recent adjustments.
2025-12-20 20:09:37 +00:00
Pádraig Brady
7be8402e1e doc: split,tac: document $TMPDIR usage
Following commit v9.3-92-g1b86b70dd
$TMPDIR is part of the interface and an important behavioral
characteristic of a command, which should be documented.

* doc/coreutils.texi (split invocation): Mention $TMPDIR is honored.
(tac invocation): Likewise.
* src/split.c (usage): Likewise.
* src/tac.c (usage): Likewise.
2025-12-19 00:09:58 +00:00
Collin Funk
a2c3896b51 doc: tee: prefer cksum in examples
* doc/coreutils.texi (tee invocation): Use 'cksum' with '-a sha2' and
'-a sha3' instead of md5sum and sha1sum in examples.
2025-12-16 22:15:26 -08:00
Collin Funk
3b809382b8 doc: dd: document the behavior of conv flags on multibyte characters
* doc/coreutils.texi (dd invocation): Document the behavior of 'dd' on
multibyte characters and some unspecified behavior that will be
documented in a future POSIX release [1].

[1] https://austingroupbugs.net/view.php?id=1959
2025-12-13 18:55:00 -08:00
Pádraig Brady
cdb966adb3 doc: expand on shell-escape quoting style
* doc/coreutils.texi (quotingStyles): Expand on the advantages
of "shell-escape" quoting, and mention it's the default when
outputting to a tty. Also mention how it's also useful with
LC_ALL=C to further disambiguate output.  Also reference the
separate page detailing various considerations and options
for file name quoting.  Also move the mention of the default
quoting style to the top of the page where it's more obvious.
2025-12-12 17:08:00 +00:00
Pádraig Brady
f01195cf98 doc: support html post processing in all cases
Previously the html-local make rule only worked for `make html`.
Instead add support for `make doc/coreutils.html` or `make web-manual`
through the use of a makeinfo wrapper.

* doc/local.mk: Move post processing from here to ...
* build-aux/makeinfo-wrapper.sh: ... here.
* cfg.mk: Ensure our wrapper is called with MAKEINFO.
Also pass --no-node-files so redirection html files
are not created for each anchor.
2025-12-10 16:02:30 +00:00
Collin Funk
828073db6b doc: printf: mention how to print arguments starting with '-'
* doc/coreutils.texi (printDash): New macro.
(printf invocation, yes invocation): Use it.
Addresses https://bugs.gnu.org/79896
2025-12-09 18:45:22 -08:00
Pádraig Brady
15092bd518 doc: fix stale linuxjournal.com link
* doc/coreutils.texi: Update to working link.
Fixes https://bugs.gnu.org/79973
2025-12-09 14:10:58 +00:00
Collin Funk
d1ac0f86b5 doc: html: fix build with parallel make
* doc/local.mk (html-local): Add html files to prerequisites so they are
generated before 'sed' is invoked.  Also interate over the already
populated $(HTMLS) to be more general (to multiple html files),
and more portable (to non GNU make).
2025-12-09 13:23:28 +00:00
Pádraig Brady
0013f0e2ad doc: fix pdf generation
* doc/coreutils.texi: Explicitly supply empty arguments to macros,
as dvi (a required prerequisite to pdf) is more strict in its
handling of macro arguments.
* cfg.mk (sc_texi_ensure_empty_option_args): Add a syntax check,
since this is not verified in the default build.
Reported by Collin Funk.
2025-12-08 14:36:24 +00:00
Pádraig Brady
796b8d1a66 doc: html: reference each command option
* doc/coreutils.texi: Add anchors to each command option.
This also has the advantage of removing over 1000 lines,
through the use of macros.
2025-12-05 16:40:00 +00:00
Pádraig Brady
cc3499326f doc: html: support defined anchors for command options
* doc/coreutils.texi (optAnchor): A new macro to output a
referencable anchor, called from ...
(optItem): ... here; a new macro to output all index entries
for each option item.
(optZero,optZeroTerminated): Show an example of the adjustment
done to each option description.
* doc/local.mk (html-local): Post-process the texinfo generated HTML
(`make html`) to remove our "-option" tag, and replace all
escaped _002d with a standard hyphen, which is fine in URLs.
2025-12-05 16:32:14 +00:00
Collin Funk
cddb58a978 doc: du: mention the behavior when both --threshold and --total are used
* doc/coreutils.texi (du invocation): Mention that --threshold has no
effect on the grand total calculated when --total is used.
Addresses https://bugs.gnu.org/71309
2025-11-30 11:24:10 -08:00
Collin Funk
90856dd867 du: add the short option -A corresponding to --apparent-size
The --apparent-size option to 'du' was added in
coreutils-4.5.8 (2003). FreeBSD 8.0 (2009) added the same functionality
under the short option -A. This long option previously had no short
option, so this patch adds -A to be compatible with FreeBSD.

* NEWS: Mention the new short option.
* doc/coreutils.texi: Document the short option.
* src/du.c (usage): Likewise.
(APPARENT_SIZE_OPTION): Remove definition.
(EXCLUDE_OPTION): Define to CHAR_MAX + 1.
(long_options): Use the -A short option for --apparent-size.
(main): Likewise.
* tests/du/apparent.sh: Test that '-b', '-A -B 1', and
'--apparent-size --block-size 1' function the same.
2025-11-28 14:08:31 -08:00
Collin Funk
b1ccb268b1 doc: cksum: document secure hash algorithms
* doc/coreutils.texi (cksum general options): Mention hash algorithms
that are currently considered secure against malicious tampering.
2025-11-23 13:32:35 -08:00
Pádraig Brady
d611bcbfff tail: add --debug to report the --follow implementation
* doc/coreutils.texi (tail invocation): Describe --debug.
* src/tail.c (tail_forever, tail_forever_inotify): Output
which --follow implementation is being used.
* tests/tail/debug.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
2025-11-17 13:55:12 +00:00
Pádraig Brady
f8137811d9 wc: fix missing documentation for the --debug option
* doc/coreutils.texi (wc invocation): Desscribe --debug.
* src/wc.c (usage): Likewise.
* NEWS: Mention the bug fix.
2025-11-16 17:18:03 +00:00
Pádraig Brady
faf8d8998c doc: shred: clarify what --verbose outputs
* doc/coreutils.texi (shred invocation): Give more details on what
--verbose outputs, to give some indication of its utility.
* src/shred.c (usage): Likewise.  Also since we're changing the string,
split out translations to give translators more granular translations.
2025-11-14 13:23:09 +00:00
Pádraig Brady
574b1b938c doc: cksum: clarify support of --text and --binary
Make the documentation more accurate following v9.3-80-g5e1e0993b

* doc/coreutils.texi (cksum common options): State that --text and
--binary are actually supported, but only to support emulation
of the legacy utils.
2025-11-07 16:36:08 +00:00
Collin Funk
1654bd8628 doc: mention nanosecond decimal points with --iso-8601=ns
Many people are used to seeing ISO 8601 dates using a period separating
seconds and nanoseconds. This behavior seems to be worth documenting
given the bug reports:
https://bugs.gnu.org/63119
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118970

* doc/coreutils.texi (Options for date): Mention that
'date --iso-8601=ns' uses a comma as a separator, following the
preference of ISO 8601. Give an example of how to get an ISO 8601 date
with a period separator.
2025-11-05 14:18:38 +00:00
Collin Funk
2b3eb795c8 sort: use the more efficient posix_spawn to invoke --compress-program
* NEWS: Mention the improvement. Mention that 'sort' will continue
without compressing temporary files if the program specified by
--compress-program cannot be executed.
* doc/coreutils.texi (sort invocation): Document the behavior when the
program specified by --compress-program cannot be executed.
* src/sort.c: Include spawn.h.
(MAX_FORK_TRIES_COMPRESS, MAX_FORK_TRIES_DECOMPRESS): Remove definition.
(MAX_TRIES_COMPRESS, MAX_TRIES_DECOMPRESS): New definitions based on
MAX_FORK_TRIES_COMPRESS and MAX_FORK_TRIES_DECOMPRESS.
(async_safe_die): Remove function.
(posix_spawn_file_actions_move_fd): New function.
(pipe_fork): Remove function.
(pipe_child): New function based on pipe_fork. Return an error number
instead of a pid. Use posix_spawnp instead of calling fork and expecting
the caller to exec.
(maybe_create_temp): Call pipe_child instead of pipe_fork. Print a
warning to standard error if --compress-program cannot be executed and
the error is different than the previous call. Remove code for the child
process.
(open_temp): Remove code for the child process. Improve error message.
* tests/sort/sort-compress.sh: Add a test case for when the program
specified by --compress-program does not exist.
2025-10-25 12:59:08 -07:00
Pádraig Brady
0f7babad38 numfmt: add --unit-separator
Output, accept, or disallow a string between the number and unit
as recommended in <https://physics.nist.gov/cuu/Units/checklist.html>
I.e. support outputting numbers of the form: "1234 M"

* src/numfmt.c (simple_strtod_human): Skip unit separator if present,
or disallow a unit separator if empty.
(double_to_human): Output unit separator if specified.
(main): Accept --unit-separator.
* tests/misc/numfmt.pl: Add test cases.
* doc/coreutils.texi: Describe the new option,
giving examples of interaction with --delimiter.
* NEWS: Mention the new feature.
* THANKS.in: Add Johannes Schauer Marin Rodrigues,
who provided a preliminary patch.
2025-10-17 19:16:26 +01:00
Pádraig Brady
8bc11f80a3 numfmt: support reading numbers with NBSP before unit
* src/numfmt.c (simple_strtod_human): Accept (multi-byte)
non-breaking space character between number and unit.
Note we restrict this to a single character between number
and unit, to allow less ambiguous parsing if multiple blanks
are used to delimit fields.
* tests/misc/numfmt.pl: Add test cases.
* doc/coreutils.texi (numfmt invocation): Fix stale description
--delimiter skipping whitespace.
* NEWS: Mention the improvement.
2025-10-17 17:26:25 +01:00
Pádraig Brady
d766efc7e4 doc: document gl_cv_crc_pclmul to control hardware acceleration
doc/coreutils.texi (Harware acceleration configuration):
Sort the list and add "gl_cv_crc_pclmul".
2025-09-23 20:28:19 +01:00
Collin Funk
2d2eb2cbe8 doc: don't capitalize the first letter of cgroup
This is the correct way to write it as described in the documentation:
<https://docs.kernel.org/admin-guide/cgroup-v2.html#terminology>.

* doc/coreutils.texi (nproc invocation): Use cgroup instead of Cgroup.
2025-09-20 15:21:41 +01:00
Pádraig Brady
168ae824f7 doc: add hardware acceleration configuration docs
* NEWS: Mention the new GLIBC_TUNABLES feature.
* doc/coreutils.texi (Hardware Acceleration): A new node
detailing the build time and run time configuration options.
2025-09-17 00:22:50 +01:00
Pádraig Brady
07eedce2d3 doc: update the md5/sha1 "weak hash" advisory
* doc/coreutils.texi: Adjust advisory for md5sum and sha1sum
to include "sha3", and also the more general `cksum -a` interface.
2025-09-04 18:19:15 +01:00
Pádraig Brady
aba9800995 cksum: prefer -a sha2 -l ###, to -a sha###
To make the interface more concise and consistent,
while being backwards compatible.

* src/digest.c (main): Continue to support -a "sha###" but
also support -a "sha2" and treat it like "sha3", except in...
(output_file): ... maintain the legacy tags for better compatability.
* doc/coreutils.texi (cksum invocation): Document the -a sha2 option.
* tests/cksum/cksum-base64.pl: Adjust as per modified --help.
* tests/cksum/cksum-c.sh: Add new supported SHA2-### tagged variant.
* NEWS: Mention the new feature.
2025-09-04 14:49:07 +01:00
Collin Funk
403d82a0bf cksum: add support for SHA-3
* src/digest.c: Include sha3.h.
(BLAKE2B_MAX_LEN): Rename to
DIGEST_MAX_LEN since it is also used for SHA-3.
(sha3_sum_stream): New function.
(enum Algorithm, algorithm_args, algorithm_args, algorithm_types)
algorithm_tags, algorithm_bits, cksumfns, cksum_output_fns): Add entries
for SHA-3.
(usage): Mention that SHA-3 is supported. Mention requirements for
--length with SHA-3.
(split_3): Use DIGEST_MAX_LEN instead of BLAKE2B_MAX_LEN. Determine the
length of the digest for SHA-3. Make sure it is 224, 256, 384, or 512.
(digest_file): Set the digest length in bytes. Use DIGEST_MAX_LEN
instead of BLAKE2B_MAX_LEN. Always append the digest length to SHA3 in
the output.
(main): Allow the use of --length with 'cksum -a sha3'.  Use
DIGEST_MAX_LEN instead of BLAKE2B_MAX_LEN. Make sure it is 224, 256,
384, or 512.
* tests/cksum/cksum-base64.pl (@pairs): Add expected sha3 output.
(fmt): Modify the output to use SHA3-512 since that is the default.
(@Tests): Modify arguments for sha3 to use --length=512.
* tests/cksum/cksum-sha3.sh: New test, based on tests/cksum/b2sum.sh.
* tests/local.mk (all_tests): Add the test.
* bootstrap.conf: Add crypto/sha3.
* gnulib: Update to latest commit.
* NEWS: Mention the change.
* doc/coreutils.texi (cksum general options): Mention sha3 as a
supported argument to the -a option. Mention that 'cksum -a sha3'
supports the --length option. Mention that SHA-3 is considered secure.
2025-09-03 22:29:33 -07:00
Collin Funk
7d0d9658f9 fold: add the --characters option
* src/fold.c: Include mcel.h.
(count_bytes): Remove variable.
(counting_mode, last_character_width): New variables.
(shortopts, long_options): Add the option.
(adjust_column): If --characters is in used account for number of
characters instead of their width.
(fold_file): Use getline and iterate over the result with mcel functions
to handle multibyte characters.
(main): Check for the option.
* src/local.mk (src_fold_LDADD): Add $(LIBC32CONV), $(LIBUNISTRING), and
$(MBRTOWC_LIB).
* tests/fold/fold-characters.sh: New file.
* tests/fold/fold-spaces.sh: New file.
* tests/fold/fold-nbsp.sh: New file.
* tests/local.mk (all_tests): Add the tests.
* NEWS: Mention the new option.
* doc/coreutils.texi (fold invocation): Likewise.
2025-08-22 22:09:50 -07:00