Subject: Re: bug#49716: no -print0 for ls?

From: Paul Eggert <[email-masked]>
Date: Wed, 28 Jul 2021 12:37:14 -0700

On 7/28/21 4:57 AM, Pádraig Brady wrote:
> I see --zero implies --format=single-column, but allows --format=long.
> That's the right default, but also most flexible.

Yes, it's a little tricky here.

For quite some time the ls -1 (digit 1 option) code has disagreed with 
its documentation. The doc said '-1' is equivalent to 
'--format=single-column', but the code makes '-l -1' equivalent to '-l' 
whereas '-l --format=single-column' is equivalent to no option at all.

I see three possible fixes here:

1. Change the doc to match the code, i.e., change the documentation to 
say that -1 is not the same thing as --format=single-column.

2. Change the code so that --format=single-column also has no effect 
after -l, and change the doc to document this.

3. Change the code to match the doc.

(3) would not conform to POSIX, so that's out. (1) is less work for us 
and does not affect existing uses, so I installed the first attached 
patch to implement (1). This first patch also cleans up a bunch of other 
documentation cruft that I noticed in the 'ls' documentation. The second 
patch updates up some old-fashioned terminology I noticed while working 
on the first patch.

You could talk me into (2), I suppose....
From dd6591b20e0841e5aecaa082bac1f959a5e18f9c Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Wed, 28 Jul 2021 11:26:48 -0700
Subject: [PATCH 1/2] doc: improve ls documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/coreutils.texi (ls invocation): Document implementation more
closely.  Be more consistent about style.  Omit some needless words.
* src/ls.c (usage): Don’t overdocument -f, as the details were wrong.
Omit -1 advice as it’s a bit obsolete now that we have --zero and
is a bit much for --usage output anyway.
---
 doc/coreutils.texi | 173 ++++++++++++++++++++++++---------------------
 src/ls.c           |  15 ++--
 2 files changed, 99 insertions(+), 89 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 2d2770864..64cadf634 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7350,7 +7350,8 @@ and @command{vdir}, which list information about files.
 
 The @command{ls} program lists information about files (of any type,
 including directories).  Options and file arguments can be intermixed
-arbitrarily, as usual.
+arbitrarily, as usual.  Later options override earlier options that
+are incompatible.
 
 For non-option command-line arguments that are directories, by default
 @command{ls} lists the contents of directories, not recursively, and
@@ -7460,10 +7461,10 @@ Do not dereference symbolic links, with one exception:
 if a command line argument specifies a symbolic link that refers to
 a directory, show information for that directory rather than for the
 link itself.
-This is the default behavior when no other dereferencing-related
-option has been specified (@option{--classify} (@option{-F}),
+This is the default behavior unless long format is being used
+or any of the following options is in effect:
+@option{--classify} (@option{-F}),
 @option{--directory} (@option{-d}),
-(@option{-l}),
 @option{--dereference} (@option{-L}), or
 @option{--dereference-command-line} (@option{-H})).
 
@@ -7541,7 +7542,7 @@ default, only file names are shown.
 @item --author
 @opindex --author
 @cindex hurd, author, printing
-List each file's author when producing long format directory listings.
+In long format, list each file's author.
 In GNU/Hurd, file authors can differ from their owners, but in other
 operating systems the two are the same.
 
@@ -7550,8 +7551,7 @@ operating systems the two are the same.
 @opindex -D
 @opindex --dired
 @cindex dired Emacs mode support
-With the long listing (@option{-l}) format, print an additional line after
-the main output:
+Print an additional line after the main output:
 
 @example
 //DIRED// @var{beg1} @var{end1} @var{beg2} @var{end2} @dots{}
@@ -7563,7 +7563,8 @@ byte position of the beginning and end of each file name in the output.
 This makes it easy for Emacs to find the names, even when they contain
 unusual characters such as space or newline, without fancy searching.
 
-If directories are being listed recursively (@option{-R}), output a similar
+If directories are being listed recursively via
+@option{--recursive} (@option{-R}), output a similar
 line with offsets for each subdirectory name:
 
 @example
@@ -7608,7 +7609,7 @@ $ ls -gloRF --dired a
 //DIRED-OPTIONS// --quoting-style=literal
 @end example
 
-Note that the pairs of offsets on the @samp{//DIRED//} line above delimit
+The pairs of offsets on the @samp{//DIRED//} line above delimit
 these names: @file{f1}, @file{f2}, @file{sub}, @file{sub2}, @file{deeper},
 @file{file}.
 The offsets on the @samp{//SUBDIRED//} line delimit the following
@@ -7623,11 +7624,12 @@ $ dd bs=1 skip=222 count=6 < out 2>/dev/null; echo
 deeper
 @end example
 
-Note that although the listing above includes a trailing slash
+Although the listing above includes a trailing slash
 for the @samp{deeper} entry, the offsets select the name without
 the trailing slash.  However, if you invoke @command{ls} with @option{--dired}
-along with an option like @option{--escape} (aka @option{-b}) and operate
-on a file whose name contains special characters, notice that the backslash
+(@option{-D}) along with an option like
+@option{--escape} (@option{-b}) and operate
+on a file whose name contains special characters, the backslash
 @emph{is} included:
 
 @example
@@ -7638,29 +7640,33 @@ $ ls -blog --dired 'a b'
 //DIRED-OPTIONS// --quoting-style=escape
 @end example
 
-If you use a quoting style that adds quote marks
-(e.g., @option{--quoting-style=c}), then the offsets include the quote marks.
+If you use a quoting style like @option{--quoting-style=c} (@option{-Q})
+that adds quote marks, then the offsets include the quote marks.
 So beware that the user may select the quoting style via the environment
 variable @env{QUOTING_STYLE}@.  Hence, applications using @option{--dired}
-should either specify an explicit @option{--quoting-style=literal} option
-(aka @option{-N} or @option{--literal}) on the command line, or else be
+should either specify an explicit @option{--quoting-style=literal}
+(@option{-N}) option on the command line, or else be
 prepared to parse the escaped names.
 
+The @option{--dired} (@option{-D}) option has well-defined behavior
+only when long format is in effect and hyperlinks are disabled (e.g.,
+@option{--hyperlink=none}).
+
 @item --full-time
 @opindex --full-time
-Produce long format directory listings, and list times in full.  It is
-equivalent to using @option{--format=long} with
+Produce long format, and list times in full.  It is
+equivalent to using @option{--format=long} (@option{-l}) with
 @option{--time-style=full-iso} (@pxref{Formatting file timestamps}).
 
 @item -g
 @opindex -g
-Produce long format directory listings, but don't display owner information.
+Produce long format, but omit owner information.
 
 @item -G
 @itemx --no-group
 @opindex -G
 @opindex --no-group
-Inhibit display of group information in a long format directory listing.
+Inhibit display of group information in long format.
 (This is the default in some non-GNU versions of @command{ls}, so we
 provide this option for compatibility.)
 
@@ -7682,6 +7688,7 @@ uniquely identifies each file within a particular file system.)
 @opindex --format
 @opindex long ls @r{format}
 @opindex verbose ls @r{format}
+Produce long format.
 In addition to the name of each file, print the file type, file mode bits,
 number of hard links, owner name, group name, size, and
 timestamp (@pxref{Formatting file timestamps}), normally
@@ -7693,7 +7700,8 @@ Print question marks for other information that
 cannot be determined.
 
 Normally the size is printed as a byte count without punctuation, but
-this can be overridden (@pxref{Block size}).  For example, @option{-h}
+this can be overridden (@pxref{Block size}).
+For example, @option{--human-readable} (@option{-h})
 prints an abbreviated, human-readable count, and
 @samp{--block-size="'1"} prints a byte count with the thousands
 separator of the current locale.
@@ -7798,14 +7806,15 @@ is marked with a @samp{+} character.
 @opindex --numeric-uid-gid
 @cindex numeric uid and gid
 @cindex numeric user and group IDs
-Produce long format directory listings, but
+Produce long format, but
 display right-justified numeric user and group IDs
 instead of left-justified owner and group names.
 
 @item -o
 @opindex -o
-Produce long format directory listings, but don't display group information.
-It is equivalent to using @option{--format=long} with @option{--no-group} .
+Produce long format, but omit group information.
+It is equivalent to using @option{--format=long} (@option{-l})
+with @option{--no-group} (@option{-G}).
 
 @item -s
 @itemx --size
@@ -7836,8 +7845,7 @@ it also affects the HP-UX @command{ls} program.
 @cindex SELinux
 @cindex security context
 Display the SELinux security context or @samp{?} if none is found.
-When used with the @option{-l} option, print the security context
-to the left of the size column.
+In long format, print the security context to the left of the size column.
 
 @end table
 
@@ -7860,20 +7868,20 @@ it outputs.  By default, sorting is done by character code
 @opindex ctime@r{, printing or sorting by}
 @opindex status time@r{, printing or sorting by}
 @opindex use time@r{, printing or sorting files by}
-If the long listing format (e.g., @option{-l}, @option{-o}) is being used,
+In long format,
 print the status change timestamp (the ctime) instead of the mtime.
-When explicitly sorting by time (@option{--sort=time} or @option{-t})
-or when not using a long listing format,
+When sorting by time or when not using long format,
 sort according to the ctime.  @xref{File timestamps}.
 
 @item -f
 @opindex -f
 @cindex unsorted directory listing
 @cindex directory order, listing by
-Primarily, like @option{-U}---do not sort; list the files in whatever
-order they are stored in the directory.  But also enable @option{-a} (list
-all files) and disable @option{-l}, @option{--color}, and @option{-s} (if they
-were specified before the @option{-f}).
+Produce an unsorted directory listing.
+This is equivalent to the combination of @option{--all} (@option{-a}),
+@option{--sort=none} (@option{-U}), @option{-1},
+@option{--color=none}, and @option{--hyperlink=none},
+while also disabling any previous use of @option{--size} (@option{-s}).
 
 @item -r
 @itemx --reverse
@@ -7882,6 +7890,8 @@ were specified before the @option{-f}).
 @cindex reverse sorting
 Reverse whatever the sorting method is---e.g., list files in reverse
 alphabetical order, youngest first, smallest first, or whatever.
+This option has no effect when @option{--sort=none} (@option{-U})
+is in effect.
 
 @item -S
 @itemx --sort=size
@@ -7908,10 +7918,9 @@ The timestamp to order by can be changed with the @option{--time} option.
 @opindex use time@r{, printing or sorting files by}
 @opindex atime@r{, printing or sorting files by}
 @opindex access timestamp@r{, printing or sorting files by}
-If the long listing format (e.g., @option{--format=long}) is being used,
-print the last access timestamp (the atime).
-When explicitly sorting by time (@option{--sort=time} or @option{-t})
-or when not using a long listing format, sort according to the atime.
+In long format, print the last access timestamp (the atime).
+When sorting by time or when not using long format,
+sort according to the atime.
 @xref{File timestamps}.
 
 @item --time=birth
@@ -7919,10 +7928,9 @@ or when not using a long listing format, sort according to the atime.
 @opindex --time
 @opindex birth time@r{, printing or sorting files by}
 @opindex creation timestamp@r{, printing or sorting files by}
-If the long listing format (e.g., @option{--format=long}) is being used,
-print the file creation timestamp if available.
-When explicitly sorting by time (@option{--sort=time} or @option{-t})
-or when not using a long listing format, sort according to the birth time.
+In long format, print the file creation timestamp if available.
+When sorting by time or when not using long format,
+sort according to the birth time.
 @xref{File timestamps}.
 
 @item -U
@@ -7932,8 +7940,8 @@ or when not using a long listing format, sort according to the birth time.
 @opindex none@r{, sorting option for @command{ls}}
 Do not sort; list the files in whatever order they are
 stored in the directory.  (Do not do any of the other unrelated things
-that @option{-f} does.)  This is especially useful when listing very large
-directories, since not doing any sorting can be noticeably faster.
+that @option{-f} does.)  This can be useful when listing large
+directories, where sorting can take some time.
 
 @item -v
 @itemx --sort=version
@@ -7942,13 +7950,13 @@ directories, since not doing any sorting can be noticeably faster.
 @opindex version@r{, sorting option for @command{ls}}
 Sort by version name and number, lowest first.  It behaves like a default
 sort, except that each sequence of decimal digits is treated numerically
-as an index/version number.  (@xref{Version sort ordering}.)
+as an index/version number.  @xref{Version sort ordering}.
 
 @item --sort=width
 @opindex --sort
 @opindex width@r{, sorting option for @command{ls}}
 Sort by printed width of file names.
-This is especially useful with the default @option{--format=vertical}
+This can be useful with the @option{--format=vertical} (@option{-C})
 output format, to most densely display the listed files.
 
 @item -X
@@ -7969,30 +7977,35 @@ These options affect the appearance of the overall output.
 
 @table @samp
 
-@item -1
-@itemx --format=single-column
-@opindex -1
+@item --format=single-column
 @opindex --format
 @opindex single-column @r{output of files}
-List one file per line.  This is the default for @command{ls} when standard
-output is not a terminal.  See also the @option{-b} and @option{-q} options
-to suppress direct output of newline characters within a file name.
+List one file name per line, with no other information.
+This is the default for @command{ls} when standard
+output is not a terminal.  See also the @option{--escape} (@option{-b}),
+@option{--hide-control-chars} (@option{-q}), and @option{--zero} options
+to disambiguate output of file names containing newline characters.
+
+@item -1
+@opindex -1
+List one file per line.  This is like @option{--format=single-column}
+except that it has no effect if long format is also in effect.
 
 @item -C
 @itemx --format=vertical
 @opindex -C
 @opindex --format
 @opindex vertical @r{sorted files in columns}
-List files in columns, sorted vertically.  This is the default for
-@command{ls} if standard output is a terminal.  It is always the default
-for the @command{dir} program.
+List files in columns, sorted vertically, with no other information.
+This is the default for @command{ls} if standard output is a terminal.
+It is always the default for the @command{dir} program.
 GNU @command{ls} uses variable width columns to display as many files as
 possible in the fewest lines.
 
 @item --color [=@var{when}]
 @opindex --color
 @cindex color, distinguishing file types with
-Specify whether to use color for distinguishing file types.  @var{when}
+Specify whether to use color for distinguishing file types; @var{when}
 may be omitted, or one of:
 @itemize @bullet
 @item none
@@ -8009,12 +8022,12 @@ may be omitted, or one of:
 Specifying @option{--color} and no @var{when} is equivalent to
 @option{--color=always}.
 If piping a colorized listing through a pager like @command{less},
-use the @option{-R} option to pass the color codes to the terminal.
+use the pager's @option{-R} option to pass the color codes to the terminal.
 
 @vindex LS_COLORS
 @vindex SHELL @r{environment variable, and color}
-Note that using the @option{--color} option may incur a noticeable
-performance penalty when run in a directory with very many entries,
+Using the @option{--color} option may incur a noticeable
+performance penalty when run in a large directory,
 because the default settings require that @command{ls} @code{stat} every
 single file it lists.
 However, if you would like most of the file-type coloring
@@ -8068,7 +8081,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}),
 @opindex --indicator-style
 @cindex file type, marking
 Append a character to each file name indicating the file type.  This is
-like @option{-F}, except that executables are not marked.
+like @option{--classify} (@option{-F}, except that executables are not marked.
 
 @item --hyperlink [=@var{when}]
 @opindex --hyperlink
@@ -8108,8 +8121,8 @@ for FIFOs, @samp{=} for sockets, and nothing for regular files.  This is
 the same as the @option{--file-type} option.
 @item classify
 Append @samp{*} for executable regular files, otherwise behave as for
-@samp{file-type}.  This is the same as the @option{-F} or
-@option{--classify} option.
+@samp{file-type}.  This is the same as the @option{--classify}
+(@option{-F}) option.
 @end table
 
 @item -k
@@ -8118,16 +8131,15 @@ Append @samp{*} for executable regular files, otherwise behave as for
 @opindex --kibibytes
 Set the default block size to its normal value of 1024 bytes,
 overriding any contrary specification in environment variables
-(@pxref{Block size}).  If @option{--block-size}, @option{-h},
-@option{--human-readable}, or @option{--si} options are used,
-they take precedence over @option{-k} or @option{--kibibytes}
-even if @option{-k} or @option{--kibibytes} is placed after
-the other options.
+(@pxref{Block size}).  If @option{--block-size},
+@option{--human-readable} (@option{-h}), or @option{--si} options are used,
+they take precedence even if @option{--kibibytes} (@option{-k}) is placed after
 
-The @option{-k} or @option{--kibibytes} option affects the
-per-directory block count written by the @option{-l} and similar
-options, and the size written by the @option{-s} or @option{--size}
-option.  It does not affect the file size written by @option{-l}.
+The @option{--kibibytes} (@option{-k}) option affects the
+per-directory block count written in long format,
+and the disk allocation written by the @option{--size} (@option{-s})
+option.  It does not affect the file size in bytes that is written in
+long format.
 
 @item -m
 @itemx --format=commas
@@ -8135,17 +8147,16 @@ option.  It does not affect the file size written by @option{-l}.
 @opindex --format
 @opindex commas@r{, outputting between files}
 List files horizontally, with as many as will fit on each line,
-separated by @samp{, } (a comma and a space).
+separated by @samp{, } (a comma and a space),
+and with no other information.
 
 @item --zero
 @opindex --zero
-This option is incompatible with the @option{-D} or @option{--dired} option.
-This option also implies the options
-@option{--show-control-chars},
-@option{-1} or @option{--format=single-column},
-@option{--color=none}, and
-@option{-N} or @option{--quoting-style=literal}.
 @outputNUL
+This option is incompatible with the @option{--dired} (@option{-D}) option.
+This option also implies the options @option{--show-control-chars},
+@option{-1}, @option{--color=none}, and
+@option{--quoting-style=literal} (@option{-N}).
 
 @item -p
 @itemx --indicator-style=slash
@@ -8375,8 +8386,8 @@ be one of the following:
 @macro quotingStyles
 @table @samp
 @item literal
-Output strings as-is; this is the same as the @option{-N} or
-@option{--literal} option.
+Output strings as-is; this is the same as the @option{--literal} (@option{-N})
+option.
 @item shell
 Quote strings for the shell if they contain shell metacharacters or would
 cause ambiguous output.
@@ -8394,11 +8405,11 @@ normally not require quoting.
 @item c
 Quote strings as for C character string literals, including the
 surrounding double-quote characters; this is the same as the
-@option{-Q} or @option{--quote-name} option.
+@option{--quote-name} (@option{-Q}) option.
 @item escape
 Quote strings as for C character string literals, except omit the
 surrounding double-quote
-characters; this is the same as the @option{-b} or @option{--escape} option.
+characters; this is the same as the @option{--escape} (@option{-b}) option.
 @item clocale
 Quote strings as for C character string literals, except use
 surrounding quotation marks appropriate for the
diff --git a/src/ls.c b/src/ls.c
index 7ea956227..b2e753dc8 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -1938,15 +1938,15 @@ decode_switches (int argc, char **argv)
           break;
 
         case 'f':
-          /* Same as enabling -a -U and disabling -l -s.  */
+          /* Same as -a -U -1 --color=none --hyperlink=none,
+             while disabling -s.  */
           ignore_mode = IGNORE_MINIMAL;
           sort_opt = sort_none;
-          /* disable -l */
           if (format_opt == long_format)
             format_opt = -1;
-          print_block_size = false;	/* disable -s */
-          print_with_color = false;	/* disable --color */
-          print_hyperlink = false;	/* disable --hyperlink */
+          print_with_color = false;
+          print_hyperlink = false;
+          print_block_size = false;
           break;
 
         case FILE_TYPE_INDICATOR_OPTION: /* --file-type */
@@ -5428,7 +5428,7 @@ Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
   -D, --dired                generate output designed for Emacs' dired mode\n\
 "), stdout);
       fputs (_("\
-  -f                         do not sort, enable -aU, disable -ls --color\n\
+  -f                         list all entries in directory order\n\
   -F, --classify[=WHEN]      append indicator (one of */=>@|) to entries;\n\
                                WHEN can be 'always' (default if omitted),\n\
                                'auto', or 'never'\n\
@@ -5543,8 +5543,7 @@ Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
   -X                         sort alphabetically by entry extension\n\
   -Z, --context              print any security context of each file\n\
       --zero                 end each output line with NUL, not newline\n\
-  -1                         list one file per line.  Avoid '\\n' with -q or -b\
-\n\
+  -1                         list one file per line\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
-- 
2.30.2

From 7ffb9fbdec192ab00323061a99340c59fcc983df Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Wed, 28 Jul 2021 12:22:11 -0700
Subject: [PATCH 2/2] =?UTF-8?q?doc:=20modernize=20usage=20of=20=E2=80=9Cdi?=
 =?UTF-8?q?sk=E2=80=9D=20and=20=E2=80=9Ccore=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In documentation and comments, don’t assume that secondary storage
devices are disk devices.  Similarly, don’t assume that main memory
uses magnetic cores, which became obsolete in the 1970s.
* src/du.c (usage):
* src/ls.c (usage):
* src/shred.c (usage): Reword to avoid “disk” in usage messages.
---
 README-hacking                 |   2 +-
 doc/coreutils.texi             | 155 +++++++++++++++++----------------
 init.cfg                       |   3 +-
 man/df.x                       |  10 +--
 src/copy.c                     |   2 +-
 src/copy.h                     |   2 +-
 src/dd.c                       |   8 +-
 src/df.c                       |  62 ++++++-------
 src/du.c                       |  10 +--
 src/factor.c                   |   3 +-
 src/ioblksize.h                |   2 +-
 src/ls.c                       |   2 +-
 src/ptx.c                      |   2 +-
 src/shred.c                    |   6 +-
 src/sort.c                     |   6 +-
 src/system.h                   |   2 +-
 src/tsort.c                    |   2 +-
 tests/cp/sparse-extents.sh     |   2 +-
 tests/df/df-P.sh               |   2 +-
 tests/df/df-symlink.sh         |  11 +--
 tests/du/8gb.sh                |   2 +-
 tests/du/basic.sh              |   2 +-
 tests/du/deref.sh              |   4 +-
 tests/misc/help-version.sh     |   2 +-
 tests/other-fs-tmpdir          |   2 +-
 tests/rm/ext3-perf.sh          |   6 +-
 tests/tail-2/inotify-rotate.sh |   2 +-
 27 files changed, 161 insertions(+), 153 deletions(-)

diff --git a/README-hacking b/README-hacking
index b7bca9ec7..be9ea3766 100644
--- a/README-hacking
+++ b/README-hacking
@@ -30,7 +30,7 @@ You can get a copy of the source repository like this:
 
 As an optional step, if you already have a copy of the gnulib git
 repository, then you can use it as a reference to reduce download
-time and disk space requirements:
+time and file system space requirements:
 
         $ export GNULIB_SRCDIR=/path/to/gnulib
 
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 64cadf634..95f9466a0 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -55,11 +55,11 @@
 * cut: (coreutils)cut invocation.               Print selected parts of lines.
 * date: (coreutils)date invocation.             Print/set system date and time.
 * dd: (coreutils)dd invocation.                 Copy and convert a file.
-* df: (coreutils)df invocation.                 Report file system disk usage.
+* df: (coreutils)df invocation.                 Report file system usage.
 * dir: (coreutils)dir invocation.               List directories briefly.
 * dircolors: (coreutils)dircolors invocation.   Color setup for ls.
 * dirname: (coreutils)dirname invocation.       Strip last file name component.
-* du: (coreutils)du invocation.                 Report on disk usage.
+* du: (coreutils)du invocation.                 Report file usage.
 * echo: (coreutils)echo invocation.             Print a line of text.
 * env: (coreutils)env invocation.               Modify the environment.
 * expand: (coreutils)expand invocation.         Convert tabs to spaces.
@@ -116,7 +116,7 @@
 * stdbuf: (coreutils)stdbuf invocation.         Modify stdio buffering.
 * stty: (coreutils)stty invocation.             Print/change terminal settings.
 * sum: (coreutils)sum invocation.               Print traditional checksum.
-* sync: (coreutils)sync invocation.             Synchronize memory to disk.
+* sync: (coreutils)sync invocation.             Sync files to stable storage.
 * tac: (coreutils)tac invocation.               Reverse files.
 * tail: (coreutils)tail invocation.             Output the last part of files.
 * tee: (coreutils)tee invocation.               Redirect to multiple files.
@@ -196,7 +196,7 @@ Free Documentation License''.
 * Basic operations::             cp dd install mv rm shred
 * Special file types::         mkdir rmdir unlink mkfifo mknod ln link readlink
 * Changing file attributes::     chgrp chmod chown touch
-* Disk usage::                   df du stat sync truncate
+* File space usage::             df du stat sync truncate
 * Printing text::                echo printf yes
 * Conditions::                   false true test expr
 * Redirection::                  tee
@@ -346,9 +346,9 @@ Changing file attributes
 * chmod invocation::             Change access permissions
 * touch invocation::             Change file timestamps
 
-Disk usage
+File space usage
 
-* df invocation::                Report file system disk space usage
+* df invocation::                Report file system space usage
 * du invocation::                Estimate file space usage
 * stat invocation::              Report file or file system status
 * sync invocation::              Synchronize cached writes to persistent storage
@@ -3335,7 +3335,7 @@ write through a pipe to the specified shell @var{command} for each output file.
 @var{command} should use the $FILE environment variable, which is set
 to a different output file name for each invocation of the command.
 For example, imagine that you have a 1TiB compressed file
-that, if uncompressed, would be too large to reside on disk,
+that, if uncompressed, would be too large to reside on secondary storage,
 yet you must split it into individually-compressed pieces
 of a more manageable size.
 To do that, you might run this command:
@@ -4703,7 +4703,7 @@ Use directory @var{tempdir} to store temporary files, overriding the
 once, temporary files are stored in all the directories given.  If you
 have a large sort or merge that is I/O-bound, you can often improve
 performance by using this option to specify directories on different
-disks and controllers.
+file systems.
 
 @item --parallel=@var{n}
 @opindex --parallel
@@ -7707,7 +7707,7 @@ prints an abbreviated, human-readable count, and
 separator of the current locale.
 
 For each directory that is listed, preface the files with a line
-@samp{total @var{blocks}}, where @var{blocks} is the total disk allocation
+@samp{total @var{blocks}}, where @var{blocks} is the file system allocation
 for all files in that directory.  The block size currently defaults to 1024
 bytes, but this can be overridden (@pxref{Block size}).
 The @var{blocks} computed counts each hard link separately;
@@ -7820,13 +7820,13 @@ with @option{--no-group} (@option{-G}).
 @itemx --size
 @opindex -s
 @opindex --size
-@cindex disk allocation
+@cindex file system allocation
 @cindex size of files, reporting
-Print the disk allocation of each file to the left of the file name.
-This is the amount of disk space used by the file, which is usually a
+Print the file system allocation of each file to the left of the file name.
+This is the amount of file system space used by the file, which is usually a
 bit more than the file's size, but it can be less if the file has holes.
 
-Normally the disk allocation is printed in units of
+Normally the allocation is printed in units of
 1024 bytes, but this can be overridden (@pxref{Block size}).
 
 @cindex NFS mounts from BSD to HP-UX
@@ -8137,7 +8137,7 @@ they take precedence even if @option{--kibibytes} (@option{-k}) is placed after
 
 The @option{--kibibytes} (@option{-k}) option affects the
 per-directory block count written in long format,
-and the disk allocation written by the @option{--size} (@option{-s})
+and the file system allocation written by the @option{--size} (@option{-s})
 option.  It does not affect the file size in bytes that is written in
 long format.
 
@@ -8691,7 +8691,7 @@ normally has undesirable effects on special files like FIFOs and the
 ones typically found in the @file{/dev} directory.  In most cases,
 @code{cp -R --copy-contents} will hang indefinitely trying to read
 from FIFOs and special files like @file{/dev/console}, and it will
-fill up your destination disk if you use it to copy @file{/dev/zero}.
+fill up your destination file system if you use it to copy @file{/dev/zero}.
 This option has no effect unless copying recursively, and it does not
 affect the copying of symbolic links.
 
@@ -8902,8 +8902,8 @@ implementations that dereference symbolic links by default.
 @cindex copy on write
 Perform a lightweight, copy-on-write (COW) copy, if supported by the
 file system.  Once it has succeeded, beware that the source and destination
-files share the same disk data blocks as long as they remain unmodified.
-Thus, if a disk I/O error affects data blocks of one of the files,
+files share the same data blocks as long as they remain unmodified.
+Thus, if an I/O error affects data blocks of one of the files,
 the other suffers the same fate.
 
 The @var{when} value can be one of the following:
@@ -8938,8 +8938,8 @@ Remove each existing destination file before attempting to open it
 @cindex holes, copying files with
 @findex read @r{system call, and holes}
 A @dfn{sparse file} contains @dfn{holes}---a sequence of zero bytes that
-does not occupy any physical disk blocks; the @samp{read} system call
-reads these as zeros.  This can both save considerable disk space and
+does not occupy any file system blocks; the @samp{read} system call
+reads these as zeros.  This can both save considerable space and
 increase speed, since many binary files contain lots of consecutive zero
 bytes.  By default, @command{cp} detects holes in input source files via a crude
 heuristic and makes the corresponding output file sparse as well.
@@ -9519,25 +9519,25 @@ multiple of the I/O@ block size, you can use the @samp{skip_bytes},
 @samp{seek_bytes} and @samp{count_bytes} flags.  Alternatively
 the traditional method of separate @command{dd} invocations can be used.
 For example, the following shell commands copy data
-in 512 KiB blocks between a disk and a tape, but do not save
-or restore a 4 KiB label at the start of the disk:
+in 512 KiB blocks between a flash drive and a tape, but do not save
+or restore a 1 MiB area at the start of the flash drive:
 
 @example
-disk=/dev/rdsk/c0t1d0s2
-tape=/dev/rmt/0
+flash=/dev/sda
+tape=/dev/st0
 
-# Copy all but the label from disk to tape.
-(dd bs=4k skip=1 count=0 && dd bs=512k) <$disk >$tape
+# Copy all but the initial 1 MiB from flash to tape.
+(dd bs=1M skip=1 count=0 && dd bs=512k) <$flash >$tape
 
-# Copy from tape back to disk, but leave the disk label alone.
-(dd bs=4k seek=1 count=0 && dd bs=512k) <$tape >$disk
+# Copy from tape back to flash, leaving initial 1 MiB alone.
+(dd bs=1M seek=1 count=0 && dd bs=512k) <$tape >$flash
 @end example
 
 @cindex ddrescue
-@cindex disks, failing
-For failing disks, other tools come with a great variety of extra
+@cindex storage devices, failing
+For failing storage devices, other tools come with a great variety of extra
 functionality to ease the saving of as much data as possible before the
-disk finally dies, e.g.
+device finally dies, e.g.
 @uref{https://www.gnu.org/software/ddrescue/, GNU @command{ddrescue}}.
 However, in some cases such a tool is not available or the administrator
 feels more comfortable with the handling of @command{dd}.
@@ -9545,10 +9545,10 @@ As a simple rescue method, call @command{dd} as shown in the following
 example: the operand @samp{conv=noerror,sync} is used to continue
 after read errors and to pad out bad reads with NULs, while
 @samp{iflag=fullblock} caters for short reads (which traditionally never
-occur on disk based devices):
+occur on flash or similar devices):
 
 @example
-# Rescue data from an (unmounted!) partition of a failing disk.
+# Rescue data from an (unmounted!) partition of a failing device.
 dd conv=noerror,sync iflag=fullblock </dev/sda1 > /mnt/rescue.img
 @end example
 
@@ -10278,7 +10278,8 @@ the optional @var{how} parameter, supported with the long form option,
 gives control of how to more efficiently remove each directory entry.
 The @samp{unlink} parameter will just use a standard unlink call,
 @samp{wipe} will also first obfuscate bytes in the name, and
-@samp{wipesync} will also sync each obfuscated byte in the name to disk.
+@samp{wipesync} will also sync each obfuscated byte in the name to
+the file system.
 Note @samp{wipesync} is the default method, but can be expensive,
 requiring a sync for every character in every file.  This can become
 significant with many files, or is redundant if your file system provides
@@ -10327,7 +10328,7 @@ shred -v -n 1 /dev/sdd1
 @end example
 
 Similarly, to erase all data on a selected partition of
-your hard disk, you could give a command like the following.
+your device, you could give a command like the following.
 
 @example
 # 1 pass, write pseudo-random data; 3x faster than the default
@@ -10336,7 +10337,7 @@ shred -v -n1 /dev/sda5
 
 To be on the safe side, use at least one pass that overwrites using
 pseudo-random data.  I.e., don't be tempted to use @samp{-n0 --zero},
-in case some disk controller optimizes the process of writing blocks
+in case some device controller optimizes the process of writing blocks
 of all zeros, and thereby does not clear all bytes in a block.
 Some SSDs may do just that.
 
@@ -10838,7 +10839,7 @@ mknod [@var{option}]@dots{} @var{name} @var{type} [@var{major} @var{minor}]
 Unlike the phrase ``special file type'' above, the term @dfn{special
 file} has a technical meaning on Unix: something that can generate or
 receive data.  Usually this corresponds to a physical piece of hardware,
-e.g., a printer or a disk.  (These files are typically created at
+e.g., a printer or a flash drive.  (These files are typically created at
 system-configuration time.)  The @command{mknod} command is what creates
 files of this type.  Such devices can be read either a character at a
 time or a ``block'' (many characters) at a time, hence we say there are
@@ -11752,17 +11753,18 @@ For example, use @samp{touch ./12312359 main.c} or @samp{touch -t
 @exitstatus

-@node Disk usage
-@chapter Disk usage
+@node File space usage
+@chapter File space usage
 
+@cindex File space usage
 @cindex disk usage
 
-No disk can hold an infinite amount of data.  These commands report
-how much disk storage is in use or available, report other file and
-file status information, and write buffers to disk.
+No file system can hold an infinite amount of data.  These commands report
+how much storage is in use or available, report other file and
+file status information, and write buffers to file systems.
 
 @menu
-* df invocation::               Report file system disk space usage.
+* df invocation::               Report file system space usage.
 * du invocation::               Estimate file space usage.
 * stat invocation::             Report file or file system status.
 * sync invocation::             Synchronize cached writes to persistent storage.
@@ -11771,13 +11773,13 @@ file status information, and write buffers to disk.

 @node df invocation
-@section @command{df}: Report file system disk space usage
+@section @command{df}: Report file system space usage
 
 @pindex df
-@cindex file system disk usage
+@cindex file system usage
 @cindex disk usage by file system
 
-@command{df} reports the amount of disk space used and available on
+@command{df} reports the amount of space used and available on
 file systems.  Synopsis:
 
 @example
@@ -11788,7 +11790,7 @@ With no arguments, @command{df} reports the space used and available on all
 currently mounted file systems (of all types).  Otherwise, @command{df}
 reports on the file system containing each argument @var{file}.
 
-Normally the disk space is printed in units of
+Normally the space is printed in units of
 1024 bytes, but this can be overridden (@pxref{Block size}).
 Non-integer quantities are rounded up to the next higher unit.
 
@@ -11803,11 +11805,11 @@ the same device number, e.g. the early-boot pseudo file system @samp{rootfs} is
 not shown per default when already the real root device has been mounted.
 
 @cindex disk device file
-@cindex device file, disk
+@cindex device file
 If an argument @var{file} resolves to a special file containing
 a mounted file system, @command{df} shows the space available on that
 file system rather than on the file system containing the device node.
-GNU @command{df} does not attempt to determine the disk usage
+GNU @command{df} does not attempt to determine the usage
 on unmounted file systems, because on most kinds of systems doing so
 requires extremely nonportable intimate knowledge of file system structures.
 
@@ -11850,7 +11852,7 @@ Equivalent to @option{--si}.
 @cindex inode usage
 List inode usage information instead of block usage.  An inode (short
 for index node) contains information about a file such as its owner,
-permissions, timestamps, and location on the disk.
+permissions, timestamps, and location on the file system.
 
 @item -k
 @opindex -k
@@ -11872,7 +11874,7 @@ are also listed.
 @cindex file system space, retrieving old data more quickly
 Do not invoke the @code{sync} system call before getting any usage data.
 This may make @command{df} run significantly faster on systems with many
-disks, but on some systems (notably Solaris) the results may be slightly
+file systems, but on some systems (notably Solaris) the results may be slightly
 out of date.  This is the default.
 
 @item --output
@@ -11979,9 +11981,9 @@ there are many or very busy file systems.
 
 @item --total
 @opindex --total
-@cindex grand total of disk size, usage and available space
+@cindex grand total of file system size, usage and available space
 Print a grand total of all arguments after all arguments have
-been processed.  This can be used to find out the total disk size, usage
+been processed.  This can be used to find out the total size, usage
 and available space of all listed devices.  If no arguments are specified
 df will try harder to elide file systems insignificant to the total
 available space, by suppressing duplicate remote file systems.
@@ -12027,7 +12029,7 @@ all systems.
 @opindex ext4 @r{file system type}
 @opindex xfs @r{file system type}
 @opindex btrfs @r{file system type}
-A file system on a locally-mounted hard disk.  (The system might even
+A file system on a locally-mounted device.  (The system might even
 support more than one type here; GNU/Linux does.)
 
 @item iso9660@r{, }cdfs
@@ -12085,15 +12087,16 @@ or @option{-x} is used together with a file name argument.
 @cindex file space usage
 @cindex disk usage for files
 
-@command{du} reports the amount of disk space used by the set of specified files
-and for each subdirectory (of directory arguments).  Synopsis:
+@command{du} reports the amount of file system space used by the set
+of specified files and for each subdirectory (of directory arguments).
+Synopsis:
 
 @example
 du [@var{option}]@dots{} [@var{file}]@dots{}
 @end example
 
-With no arguments, @command{du} reports the disk space for the current
-directory.  Normally the disk space is printed in units of
+With no arguments, @command{du} reports the file system space for the current
+directory.  Normally the space is printed in units of
 1024 bytes, but this can be overridden (@pxref{Block size}).
 Non-integer quantities are rounded up to the next higher unit.
 
@@ -12116,12 +12119,12 @@ Show counts for all files, not just directories.
 
 @item --apparent-size
 @opindex --apparent-size
-Print apparent sizes, rather than disk usage.  The apparent size of a
+Print apparent sizes, rather than file system usage.  The apparent size of a
 file is the number of bytes reported by @code{wc -c} on regular files,
 or more generally, @code{ls -l --block-size=1} or @code{stat --format=%s}.
 For example, a file containing the word @samp{zoo} with no newline would,
 of course, have an apparent size of 3.  Such a small file may require
-anywhere from 0 to 16 KiB or more of disk space, depending on
+anywhere from 0 to 16 KiB or more of file system space, depending on
 the type and configuration of the file system on which the file resides.
 However, a sparse file created with this command:
 
@@ -12131,7 +12134,7 @@ dd bs=1 seek=2GiB if=/dev/null of=big
 
 @noindent
 has an apparent size of 2 GiB, yet on most modern
-systems, it actually uses almost no disk space.
+file systems, it actually uses almost no space.
 
 @item -B @var{size}
 @itemx --block-size=@var{size}
@@ -12151,9 +12154,9 @@ Equivalent to @code{--apparent-size --block-size=1}.
 @itemx --total
 @opindex -c
 @opindex --total
-@cindex grand total of disk space
+@cindex grand total of file system space
 Print a grand total of all arguments after all arguments have
-been processed.  This can be used to find out the total disk usage of
+been processed.  This can be used to find out the total file system usage of
 a given set of files or directories.
 
 @item -D
@@ -12162,7 +12165,7 @@ a given set of files or directories.
 @opindex --dereference-args
 Dereference symbolic links that are command line arguments.
 Does not affect other symbolic links.  This is helpful for finding
-out the disk usage of directories, such as @file{/usr/tmp}, which
+out the file system usage of directories, such as @file{/usr/tmp}, which
 are often symbolic links.
 
 @item -d @var{depth}
@@ -12207,7 +12210,7 @@ This option is equivalent to @option{--block-size=1K}.
 @opindex -L
 @opindex --dereference
 @cindex symbolic links, dereferencing in @command{du}
-Dereference symbolic links (show the disk space used by the file
+Dereference symbolic links (show the file system space used by the file
 or directory that the link points to instead of the space used by
 the link).
 
@@ -12231,8 +12234,8 @@ This option is equivalent to @option{--block-size=1M}.
 @opindex -P
 @opindex --no-dereference
 @cindex symbolic links, dereferencing in @command{du}
-For each symbolic links encountered by @command{du},
-consider the disk space used by the symbolic link.
+For each symbolic link encountered by @command{du},
+consider the file system space used by the symbolic link itself.
 
 @item -S
 @itemx --separate-dirs
@@ -12648,7 +12651,7 @@ with @env{TZ}, libc, The GNU C Library Reference Manual}.
 @section @command{sync}: Synchronize cached writes to persistent storage
 
 @pindex sync
-@cindex synchronize disk and memory
+@cindex synchronize file system and memory
 @cindex Synchronize cached writes to persistent storage
 
 @command{sync} synchronizes in memory files or file systems to persistent
@@ -12660,14 +12663,15 @@ sync [@var{option}] [@var{file}]@dots{}
 
 @cindex superblock, writing
 @cindex inodes, written buffered
-@command{sync} writes any data buffered in memory out to disk.  This can
+@command{sync} writes any data buffered in memory out to the storage device.
+This can
 include (but is not limited to) modified superblocks, modified inodes,
 and delayed reads and writes.  This must be implemented by the kernel;
 The @command{sync} program does nothing but exercise the @code{sync},
 @code{syncfs}, @code{fsync}, and @code{fdatasync} system calls.
 
 @cindex crashes and corruption
-The kernel keeps data in memory to avoid doing (relatively slow) disk
+The kernel keeps data in memory to avoid doing (relatively slow) device
 reads and writes.  This improves performance, but if the computer
 crashes, data may be lost or the file system corrupted as a
 result.  The @command{sync} command instructs the kernel to write
@@ -13934,7 +13938,8 @@ wget -O - https://example.com/dvd.iso \
 
 This technique is also useful when you want to make a @emph{compressed}
 copy of the contents of a pipe.
-Consider a tool to graphically summarize disk usage data from @samp{du -ak}.
+Consider a tool to graphically summarize file system usage data from
+@samp{du -ak}.
 For a large hierarchy, @samp{du -ak} can run for a long time,
 and can easily produce terabytes of data, so you won't want to
 rerun the command unnecessarily.  Nor will you want to save
@@ -13945,14 +13950,14 @@ until after you've compressed all of the @command{du} output:
 
 @example
 du -ak | gzip -9 > /tmp/du.gz
-gzip -d /tmp/du.gz | xdiskusage -a
+gzip -d /tmp/du.gz | checkspace -a
 @end example
 
 With @command{tee} and process substitution, you start the GUI
 right away and eliminate the decompression completely:
 
 @example
-du -ak | tee >(gzip -9 > /tmp/du.gz) | xdiskusage -a
+du -ak | tee >(gzip -9 > /tmp/du.gz) | checkspace -a
 @end example
 
 Finally, if you regularly create more than one type of
@@ -16858,7 +16863,7 @@ The precise method of calculation of load average varies somewhat
 between systems.  Some systems calculate it as the average number of
 runnable processes over the last 1, 5 and 15 minutes, but some systems
 also include processes in the uninterruptible sleep state (that is,
-those processes which are waiting for disk I/O).  The Linux kernel
+those processes which are waiting for device I/O).  The Linux kernel
 includes uninterruptible processes.
 
 @command{uptime} is installed only on platforms with infrastructure
@@ -18732,7 +18737,7 @@ $ numfmt --from=auto 1Mi
 1048576
 @end example
 
-Converting from @samp{SI} to @samp{IEC} scales (e.g. when a harddisk capacity is
+Converting from @samp{SI} to @samp{IEC} scales (e.g. when a drive's capacity is
 advertised as @samp{1TB}, while checking the drive's capacity gives lower
 values):
 
@@ -19129,7 +19134,7 @@ Hopefully, you are familiar with the basics of I/O redirection in the
 shell, in particular the concepts of ``standard input,'' ``standard output,''
 and ``standard error''.  Briefly, ``standard input'' is a data source, where
 data comes from.  A program should not need to either know or care if the
-data source is a disk file, a keyboard, a magnetic tape, or even a punched
+data source is a regular file, a keyboard, a magnetic tape, or even a punched
 card reader.  Similarly, ``standard output'' is a data sink, where data goes
 to.  The program should neither know nor care where this might be.
 Programs that only read their standard input, do something to the data,
diff --git a/init.cfg b/init.cfg
index f1b35d36e..714854648 100644
--- a/init.cfg
+++ b/init.cfg
@@ -619,7 +619,8 @@ mkfifo_or_skip_()
   if ! mkfifo "$1"; then
     # Make an exception of this case -- usually we interpret framework-creation
     # failure as a test failure.  However, in this case, when running on a SunOS
-    # system using a disk NFS mounted from OpenBSD, the above fails like this:
+    # system using a file system NFS mounted from OpenBSD, the above fails like
+    # this:
     # mkfifo: cannot make fifo 'fifo-10558': Not owner
     skip_ 'unable to create a fifo'
   fi
diff --git a/man/df.x b/man/df.x
index cc2dd9e1c..28214674b 100644
--- a/man/df.x
+++ b/man/df.x
@@ -4,20 +4,20 @@
 '\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 '\" There is NO WARRANTY, to the extent permitted by law.
 [NAME]
-df \- report file system disk space usage
+df \- report file system space usage
 [DESCRIPTION]
 This manual page
 documents the GNU version of
 .BR df .
 .B df
-displays the amount of disk space available on the file system
+displays the amount of space available on the file system
 containing each file name argument.  If no file name is given, the
-space available on all currently mounted file systems is shown.  Disk
-space is shown in 1K blocks by default, unless the environment
+space available on all currently mounted file systems is shown.
+Space is shown in 1K blocks by default, unless the environment
 variable POSIXLY_CORRECT is set, in which case 512-byte blocks are
 used.
 .PP
-If an argument is the absolute file name of a disk device node containing a
+If an argument is the absolute file name of a device node containing a
 mounted file system,
 .B df
 shows the space available on that file system rather than on the
diff --git a/src/copy.c b/src/copy.c
index 05b4d4acb..cb9018f93 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2616,7 +2616,7 @@ copy_internal (char const *src_name, char const *dst_name,
       /* If this directory has been copied before during the
          recursion, there is a symbolic link to an ancestor
          directory of the symbolic link.  It is impossible to
-         continue to copy this, unless we've got an infinite disk.  */
+         continue to copy this, unless we've got an infinite file system.  */
 
       if (is_ancestor (&src_sb, ancestors))
         {
diff --git a/src/copy.h b/src/copy.h
index a97089137..68d52e1ce 100644
--- a/src/copy.h
+++ b/src/copy.h
@@ -41,7 +41,7 @@ enum Sparse_type
      create a corresponding hole in DEST.  There is a performance penalty
      here because CP has to search for holes in SRC.  But if the holes are
      big enough, that penalty can be offset by the decrease in the amount
-     of data written to disk.   */
+     of data written to the file system.   */
   SPARSE_ALWAYS
 };
 
diff --git a/src/dd.c b/src/dd.c
index 06be4b04e..6b095982f 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -1230,7 +1230,7 @@ iwrite (int fd, char const *buf, size_t size)
       invalidate_cache (STDOUT_FILENO, 0);
 
       /* Attempt to ensure that that final block is committed
-         to disk as quickly as possible.  */
+         to stable storage as quickly as possible.  */
       conversions_mask |= C_FSYNC;
 
       /* After the subsequent fsync we'll call invalidate_cache
@@ -2112,7 +2112,7 @@ dd_copy (void)
      extra two bytes.  */
 
   /* Some devices require alignment on a sector or page boundary
-     (e.g. character disk devices).  Align the input buffer to a
+     (e.g. character flash or disk devices).  Align the input buffer to a
      page boundary to cover all bases.  Note that due to the swab
      algorithm, we must have at least one byte in the page before
      the input buffer;  thus we allocate 2 pages of slop in the
@@ -2120,8 +2120,8 @@ dd_copy (void)
 
      The page alignment is necessary on any Linux kernel that supports
      either the SGI raw I/O patch or Steven Tweedies raw I/O patch.
-     It is necessary when accessing raw (i.e., character special) disk
-     devices on Unixware or other SVR4-derived system.  */
+     It is necessary when accessing raw (i.e., character special)
+     storage devices on SVR4-derived systems.  */
 
   if (skip_records != 0 || skip_bytes != 0)
     {
diff --git a/src/df.c b/src/df.c
index 927365cfa..4534935f5 100644
--- a/src/df.c
+++ b/src/df.c
@@ -1,4 +1,4 @@
-/* df - summarize free disk space
+/* df - summarize free file system space
    Copyright (C) 1991-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -83,7 +83,7 @@ static bool file_systems_processed;
 
 /* If true, invoke the 'sync' system call before getting any usage data.
    Using this option can make df very slow, especially with many or very
-   busy disks.  Note that this may make a difference on some systems --
+   busy file systems.  This may make a difference on some systems --
    SunOS 4.1.3, for one.  It is *not* necessary on GNU/Linux.  */
 static bool require_sync;
 
@@ -986,23 +986,23 @@ add_to_grand_total (struct field_values_t *bv, struct field_values_t *iv)
                             bv->negate_available);
 }
 
-/* Obtain a space listing for the disk device with absolute file name DISK.
+/* Obtain a space listing for the device with absolute file name DEVICE.
    If MOUNT_POINT is non-NULL, it is the name of the root of the
-   file system on DISK.
+   file system on DEVICE.
    If STAT_FILE is non-null, it is the name of a file within the file
    system that the user originally asked for; this provides better
    diagnostics, and sometimes it provides better results on networked
    file systems that give different free-space results depending on
    where in the file system you probe.
-   If FSTYPE is non-NULL, it is the type of the file system on DISK.
-   If MOUNT_POINT is non-NULL, then DISK may be NULL -- certain systems may
+   If FSTYPE is non-NULL, it is the type of the file system on DEVICE.
+   If MOUNT_POINT is non-NULL, then DEVICE may be NULL -- certain systems may
    not be able to produce statistics in this case.
    ME_DUMMY and ME_REMOTE are the mount entry flags.
    Caller must set PROCESS_ALL to true when iterating over all entries, as
    when df is invoked with no non-option argument.  See below for details.  */
 
 static void
-get_dev (char const *disk, char const *mount_point, char const* file,
+get_dev (char const *device, char const *mount_point, char const* file,
          char const *stat_file, char const *fstype,
          bool me_dummy, bool me_remote,
          const struct fs_usage *force_fsu,
@@ -1027,12 +1027,12 @@ get_dev (char const *disk, char const *mount_point, char const* file,
      It would be better to report on the unmounted file system,
      but statfs doesn't do that on most systems.  */
   if (!stat_file)
-    stat_file = mount_point ? mount_point : disk;
+    stat_file = mount_point ? mount_point : device;
 
   struct fs_usage fsu;
   if (force_fsu)
     fsu = *force_fsu;
-  else if (get_fs_usage (stat_file, disk, &fsu))
+  else if (get_fs_usage (stat_file, device, &fsu))
     {
       /* If we can't access a system provided entry due
          to it not being present (now), or due to permissions,
@@ -1064,7 +1064,7 @@ get_dev (char const *disk, char const *mount_point, char const* file,
       if (stat (stat_file, &sb) == 0)
         {
           struct mount_entry const * dev_me = me_for_dev (sb.st_dev);
-          if (dev_me && ! STREQ (dev_me->me_devname, disk)
+          if (dev_me && ! STREQ (dev_me->me_devname, device)
               && (! dev_me->me_remote || ! me_remote))
             {
               fstype = "-";
@@ -1083,13 +1083,13 @@ get_dev (char const *disk, char const *mount_point, char const* file,
 
   alloc_table_row ();
 
-  if (! disk)
-    disk = "-";			/* unknown */
+  if (! device)
+    device = "-";		/* unknown */
 
   if (! file)
     file = "-";			/* unspecified */
 
-  char *dev_name = xstrdup (disk);
+  char *dev_name = xstrdup (device);
   char *resolved_dev;
 
   /* On some systems, dev_name is a long-named symlink like
@@ -1280,20 +1280,20 @@ last_device_for_mount (char const* mount)
     return NULL;
 }
 
-/* If DISK corresponds to a mount point, show its usage
+/* If DEVICE corresponds to a mount point, show its usage
    and return true.  Otherwise, return false.  */
 static bool
-get_disk (char const *disk)
+get_device (char const *device)
 {
   struct mount_entry const *me;
   struct mount_entry const *best_match = NULL;
   bool best_match_accessible = false;
   bool eclipsed_device = false;
-  char const *file = disk;
+  char const *file = device;
 
-  char *resolved = canonicalize_file_name (disk);
+  char *resolved = canonicalize_file_name (device);
   if (resolved && IS_ABSOLUTE_FILE_NAME (resolved))
-    disk = resolved;
+    device = resolved;
 
   size_t best_match_len = SIZE_MAX;
   for (me = mount_list; me; me = me->me_next)
@@ -1304,7 +1304,7 @@ get_disk (char const *disk)
       if (canon_dev && IS_ABSOLUTE_FILE_NAME (canon_dev))
         devname = canon_dev;
 
-      if (STREQ (disk, devname))
+      if (STREQ (device, devname))
         {
           char *last_device = last_device_for_mount (me->me_mountdir);
           eclipsed_device = last_device && ! STREQ (last_device, devname);
@@ -1313,10 +1313,10 @@ get_disk (char const *disk)
           if (! eclipsed_device
               && (! best_match_accessible || len < best_match_len))
             {
-              struct stat disk_stats;
+              struct stat device_stats;
               bool this_match_accessible = false;
 
-              if (stat (me->me_mountdir, &disk_stats) == 0)
+              if (stat (me->me_mountdir, &device_stats) == 0)
                 best_match_accessible = this_match_accessible = true;
 
               if (this_match_accessible
@@ -1361,12 +1361,12 @@ get_disk (char const *disk)
 }
 
 /* Figure out which device file or directory POINT is mounted on
-   and show its disk usage.
+   and show its device usage.
    STATP must be the result of 'stat (POINT, STATP)'.  */
 static void
 get_point (char const *point, const struct stat *statp)
 {
-  struct stat disk_stats;
+  struct stat device_stats;
   struct mount_entry *me;
   struct mount_entry const *best_match = NULL;
 
@@ -1398,8 +1398,8 @@ get_point (char const *point, const struct stat *statp)
     }
   free (resolved);
   if (best_match
-      && (stat (best_match->me_mountdir, &disk_stats) != 0
-          || disk_stats.st_dev != statp->st_dev))
+      && (stat (best_match->me_mountdir, &device_stats) != 0
+          || device_stats.st_dev != statp->st_dev))
     best_match = NULL;
 
   if (! best_match)
@@ -1407,8 +1407,8 @@ get_point (char const *point, const struct stat *statp)
       {
         if (me->me_dev == (dev_t) -1)
           {
-            if (stat (me->me_mountdir, &disk_stats) == 0)
-              me->me_dev = disk_stats.st_dev;
+            if (stat (me->me_mountdir, &device_stats) == 0)
+              me->me_dev = device_stats.st_dev;
             else
               {
                 /* Report only I/O errors.  Other errors might be
@@ -1430,8 +1430,8 @@ get_point (char const *point, const struct stat *statp)
             && (!best_match || best_match->me_dummy || !me->me_dummy))
           {
             /* Skip bogus mtab entries.  */
-            if (stat (me->me_mountdir, &disk_stats) != 0
-                || disk_stats.st_dev != me->me_dev)
+            if (stat (me->me_mountdir, &device_stats) != 0
+                || device_stats.st_dev != me->me_dev)
               me->me_dev = (dev_t) -2;
             else
               best_match = me;
@@ -1458,14 +1458,14 @@ get_point (char const *point, const struct stat *statp)
     }
 }
 
-/* Determine what kind of node NAME is and show the disk usage
+/* Determine what kind of node NAME is and show the device usage
    for it.  STATP is the results of 'stat' on NAME.  */
 
 static void
 get_entry (char const *name, struct stat const *statp)
 {
   if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
-      && get_disk (name))
+      && get_device (name))
     return;
 
   get_point (name, statp);
diff --git a/src/du.c b/src/du.c
index efd519706..343f2e990 100644
--- a/src/du.c
+++ b/src/du.c
@@ -1,4 +1,4 @@
-/* du -- summarize disk usage
+/* du -- summarize device usage
    Copyright (C) 1988-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -130,7 +130,7 @@ struct dulevel
 /* If true, display counts for all files, not just directories.  */
 static bool opt_all = false;
 
-/* If true, rather than using the disk usage of each file,
+/* If true, rather than using the device usage of each file,
    use the apparent size (a la stat.st_size).  */
 static bool apparent_size = false;
 
@@ -287,7 +287,7 @@ Usage: %s [OPTION]... [FILE]...\n\
   or:  %s [OPTION]... --files0-from=F\n\
 "), program_name, program_name);
       fputs (_("\
-Summarize disk usage of the set of FILEs, recursively for directories.\n\
+Summarize device usage of the set of FILEs, recursively for directories.\n\
 "), stdout);
 
       emit_mandatory_arg_note ();
@@ -295,7 +295,7 @@ Summarize disk usage of the set of FILEs, recursively for directories.\n\
       fputs (_("\
   -0, --null            end each output line with NUL, not newline\n\
   -a, --all             write counts for all files, not just directories\n\
-      --apparent-size   print apparent sizes, rather than disk usage; although\
+      --apparent-size   print apparent sizes rather than device usage; although\
 \n\
                           the apparent size is usually smaller, it may be\n\
                           larger due to holes in ('sparse') files, internal\n\
@@ -315,7 +315,7 @@ Summarize disk usage of the set of FILEs, recursively for directories.\n\
                           --summarize\n\
 "), stdout);
       fputs (_("\
-      --files0-from=F   summarize disk usage of the\n\
+      --files0-from=F   summarize device usage of the\n\
                           NUL-terminated file names specified in file F;\n\
                           if F is -, then read names from standard input\n\
   -H                    equivalent to --dereference-args (-D)\n\
diff --git a/src/factor.c b/src/factor.c
index 62a269fcf..c2bf05526 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -65,7 +65,8 @@
       from a prime.  We might instead compute the inverse on-the-fly.
 
     * Tune trial division table size (not forgetting that this is a standalone
-      program where the table will be read from disk for each invocation).
+      program where the table will be read from secondary storage for
+      each invocation).
 
     * Implement less naive powm, using k-ary exponentiation for k = 3 or
       perhaps k = 4.
diff --git a/src/ioblksize.h b/src/ioblksize.h
index 98d46eaa8..5d359d642 100644
--- a/src/ioblksize.h
+++ b/src/ioblksize.h
@@ -59,7 +59,7 @@
 
    Note that this is to minimize system call overhead.
    Other values may be appropriate to minimize file system
-   or disk overhead.  For example on my current GNU/Linux system
+   overhead.  For example on my current GNU/Linux system
    the readahead setting is 128KiB which was read using:
 
    file="."
diff --git a/src/ls.c b/src/ls.c
index b2e753dc8..03ab2f797 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -5477,7 +5477,7 @@ Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
 \n\
 "), stdout);
       fputs (_("\
-  -k, --kibibytes            default to 1024-byte blocks for disk usage;\n\
+  -k, --kibibytes            default to 1024-byte blocks for file system usage;\n\
                                used only with -s and per directory totals\n\
 "), stdout);
       fputs (_("\
diff --git a/src/ptx.c b/src/ptx.c
index c488b1192..85c26aa1d 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -2024,7 +2024,7 @@ main (int argc, char **argv)
     {
       BLOCK *text_buffer = text_buffers + file_index;
 
-      /* Read the file in core, then study it.  */
+      /* Read the file contents into memory, then study it.  */
 
       swallow_file_in_memory (input_file_name[file_index], text_buffer);
       find_occurs_in_text (file_index);
diff --git a/src/shred.c b/src/shred.c
index 7a8d38e76..ca7835512 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -203,7 +203,7 @@ and those files usually should not be removed.\n\
 The optional HOW parameter indicates how to remove a directory entry:\n\
 'unlink' => use a standard unlink call.\n\
 'wipe' => also first obfuscate bytes in the name.\n\
-'wipesync' => also sync each obfuscated byte to disk.\n\
+'wipesync' => also sync each obfuscated byte to the device.\n\
 The default mode is 'wipesync', but note it can be expensive.\n\
 \n\
 "), stdout);
@@ -629,7 +629,7 @@ free_pattern_mem:
  * The passes start and end with a random pass, and the passes in between
  * are done in random order.  The idea is to deprive someone trying to
  * reverse the process of knowledge of the overwrite patterns, so they
- * have the additional step of figuring out what was done to the disk
+ * have the additional step of figuring out what was done to the device
  * before they can try to reverse or cancel it.
  *
  * First, all possible 1-bit patterns.  There are two of them.
@@ -1018,7 +1018,7 @@ incname (char *name, size_t len)
 /*
  * Repeatedly rename a file with shorter and shorter names,
  * to obliterate all traces of the file name (and length) on any system
- * that adds a trailing delimiter to on-disk file names and reuses
+ * that adds a trailing delimiter to on-device file names and reuses
  * the same directory slot.  Finally, unlink it.
  * The passed-in filename is modified in place to the new filename.
  * (Which is unlinked if this function succeeds, but is still present if
diff --git a/src/sort.c b/src/sort.c
index 451bfe08a..cba809c33 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -132,7 +132,7 @@ enum
   {
     /* The number of times we should try to fork a compression process
        (we retry if the fork call fails).  We don't _need_ to compress
-       temp files, this is just to reduce disk access, so this number
+       temp files, this is just to reduce file system access, so this number
        can be small.  Each retry doubles in duration.  */
     MAX_FORK_TRIES_COMPRESS = 4,
 
@@ -171,7 +171,7 @@ enum blanktype { bl_start, bl_end, bl_both };
 /* The character marking end of line. Default to \n. */
 static char eolchar = '\n';
 
-/* Lines are held in core as counted strings. */
+/* Lines are held in memory as counted strings. */
 struct line
 {
   char *text;			/* Text of the line. */
@@ -3036,7 +3036,7 @@ mergefps (struct sortfile *files, size_t ntemps, size_t nfiles,
       else
         write_line (smallest, ofp, output_file);
 
-      /* Check if we need to read more lines into core. */
+      /* Check if we need to read more lines into memory. */
       if (base[ord[0]] < smallest)
         cur[ord[0]] = smallest - 1;
       else
diff --git a/src/system.h b/src/system.h
index ce264b121..3a914965f 100644
--- a/src/system.h
+++ b/src/system.h
@@ -365,7 +365,7 @@ enum
 /* Define away proper_name (leaving proper_name_utf8, which affects far
    fewer programs), since it's not worth the cost of adding ~17KB to
    the x86_64 text size of every single program.  This avoids a 40%
-   (almost ~2MB) increase in the on-disk space utilization for the set
+   (almost ~2MB) increase in the file system space utilization for the set
    of the 100 binaries. */
 #define proper_name(x) (x)
 
diff --git a/src/tsort.c b/src/tsort.c
index 33b3419c0..de4582303 100644
--- a/src/tsort.c
+++ b/src/tsort.c
@@ -49,7 +49,7 @@ struct successor
   struct successor *next;
 };
 
-/* Each string is held in core as the head of a list of successors.  */
+/* Each string is held in memory as the head of a list of successors.  */
 struct item
 {
   char const *str;
diff --git a/tests/cp/sparse-extents.sh b/tests/cp/sparse-extents.sh
index 1e9156149..8f5b68653 100755
--- a/tests/cp/sparse-extents.sh
+++ b/tests/cp/sparse-extents.sh
@@ -36,7 +36,7 @@ if false; then
 # Require more space than we'll actually use, so that
 # tests run in parallel do not run out of space.
 # Otherwise, with inadequate space, simply running the following
-# fallocate command would induce a temporary disk-full condition,
+# fallocate command would induce a temporary file-system-full condition,
 # which would cause failure of unrelated tests run in parallel.
 require_file_system_bytes_free_ 800000000
 
diff --git a/tests/df/df-P.sh b/tests/df/df-P.sh
index 3fac6c2f9..7441c6446 100755
--- a/tests/df/df-P.sh
+++ b/tests/df/df-P.sh
@@ -23,7 +23,7 @@ print_ver_ df
               df -P . > t1 || fail=1
 BLOCK_SIZE=1M df -P . > t2 || fail=1
 
-# Since disk utilization may be changing, compare only df's header line.
+# Since file system utilization may be changing, compare only df's header line.
 # That records the block size.  E.g., for "1M", it would be:
 # Filesystem         1048576-blocks      Used Available Capacity Mounted on
 # while for 1K, it would be
diff --git a/tests/df/df-symlink.sh b/tests/df/df-symlink.sh
index f15c0bd09..a2b812597 100755
--- a/tests/df/df-symlink.sh
+++ b/tests/df/df-symlink.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Ensure that df dereferences symlinks to disk nodes
+# Ensure that df dereferences symlinks to file system nodes
 
 # Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
@@ -19,12 +19,13 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ df
 
-disk=$(df --out=source '.' | tail -n1) ||
+file_system=$(df --out=source '.' | tail -n1) ||
   skip_ "cannot determine '.' file system"
 
-ln -s "$disk" symlink || framework_failure_
+ln -s "$file_system" symlink || framework_failure_
 
-df --out=source,target "$disk" > exp || skip_ "cannot get info for $disk"
+df --out=source,target "$file_system" > exp ||
+  skip_ "cannot get info for $file_system"
 df --out=source,target symlink > out || fail=1
 compare exp out || fail=1
 
@@ -34,7 +35,7 @@ compare exp out || fail=1
 # I.e., '.' => /dev/mapper/fedora-home -> /dev/dm-2
 # Restrict this test to systems with a 1:1 mapping between
 # source and target.  This excludes for example BTRFS sub-volumes.
-if test "$(df --output=source | grep -F "$disk" | wc -l)" = 1; then
+if test "$(df --output=source | grep -F "$file_system" | wc -l)" = 1; then
   df --out=source,target '.' > out || fail=1
   compare exp out || fail=1
 fi
diff --git a/tests/du/8gb.sh b/tests/du/8gb.sh
index 230dd4e30..cfa13c1d7 100755
--- a/tests/du/8gb.sh
+++ b/tests/du/8gb.sh
@@ -29,7 +29,7 @@ because file offsets are only 32 bits on this file system'
 fi
 
 # FIXME: this should be a test of dd.
-# On some systems (at least linux-2.4.18 + NFS to disks on a Solaris system)
+# On some systems (at least linux-2.4.18 + NFS to Solaris system)
 # the 'dd' command above mistakenly creates a file of length '0', yet
 # doesn't fail.  The root of that failure is that the ftruncate call
 # returns zero but doesn't do its job.  Detect this failure.
diff --git a/tests/du/basic.sh b/tests/du/basic.sh
index 162587b88..491d7a9ef 100755
--- a/tests/du/basic.sh
+++ b/tests/du/basic.sh
@@ -23,7 +23,7 @@ mkdir -p a/b d d/sub || framework_failure_
 
 # Ensure that these files contain more than 64 bytes, so that we don't
 # immediately disqualify file systems (e.g., NetApp) on which smaller
-# files take up zero disk blocks.
+# files take up zero file system blocks.
 printf '%*s' 257 make-sure-the-file-is-non-empty > a/b/F || framework_failure_
 printf %4096s x > d/1
 cp d/1 d/sub/2
diff --git a/tests/du/deref.sh b/tests/du/deref.sh
index 4eeb2104b..c48e7e9f9 100755
--- a/tests/du/deref.sh
+++ b/tests/du/deref.sh
@@ -36,8 +36,8 @@ du -sD slink b > /dev/null 2>&1 || fail=1
 # This used to fail to report the dangling symlink.
 returns_ 1 du -L dangle > /dev/null 2>&1 || fail=1
 
-# du -L used to mess up, either by counting the symlink's disk space itself
-# (-L should follow symlinks, not count their space)
+# du -L used to mess up, either by counting the symlink's file system space
+# itself (-L should follow symlinks, not count their space)
 # or (briefly in July 2010) by omitting the entry for "a".
 du_L_output=$(du -L a) || fail=1
 du_lL_output=$(du -lL a) || fail=1
diff --git a/tests/misc/help-version.sh b/tests/misc/help-version.sh
index 17d4c7032..532b60154 100755
--- a/tests/misc/help-version.sh
+++ b/tests/misc/help-version.sh
@@ -83,7 +83,7 @@ for i in $built_programs; do
   env $i --help    >/dev/null || fail=1
   env $i --version >/dev/null || fail=1
 
-  # Make sure they fail upon 'disk full' error.
+  # Make sure they fail upon 'file system full' error.
   if test -w /dev/full && test -c /dev/full; then
     test $i = [ && prog=lbracket || prog=$(echo $i|sed "s/$EXEEXT$//")
     eval "expected=\$expected_failure_status_$prog"
diff --git a/tests/other-fs-tmpdir b/tests/other-fs-tmpdir
index fbd601201..5f24c6443 100644
--- a/tests/other-fs-tmpdir
+++ b/tests/other-fs-tmpdir
@@ -45,7 +45,7 @@ done
 
 if test -z "$other_partition_tmpdir"; then
   skip_ \
-"requires a writable directory on a different disk partition,
+"requires a writable directory on a different file system,
 and I couldn't find one.  I tried these:
   $CANDIDATE_TMP_DIRS
 Set your environment variable CANDIDATE_TMP_DIRS to make
diff --git a/tests/rm/ext3-perf.sh b/tests/rm/ext3-perf.sh
index 2bbaf6a52..540357e82 100755
--- a/tests/rm/ext3-perf.sh
+++ b/tests/rm/ext3-perf.sh
@@ -21,7 +21,7 @@ print_ver_ rm
 
 very_expensive_
 
-# Using rm -rf to remove a 400k-entry directory takes:
+# In a circa 2008 benchmark, using rm -rf to remove a 400k-entry directory took:
 # - 9 seconds with the patch, on a 2-yr-old system
 # - 350 seconds without the patch, on a high-end system (disk 20-30% faster)
 threshold_seconds=60
@@ -32,9 +32,9 @@ n=400000
 # Choose a value that is large enough to ensure an accidentally
 # regressed rm would require much longer than $threshold_seconds to remove
 # the directory.  With n=400k, pre-patch GNU rm would require about 350
-# seconds even on a fast disk.  On a relatively modern system, the
+# seconds even on a fast disk.  On a circa 2006 system, the
 # patched version of rm requires about 10 seconds, so even if you
-# choose to enable very expensive tests with a disk that is much slower,
+# choose to enable very expensive tests with a device that is much slower,
 # the test should still succeed.
 
 # Skip unless "." is on an ext[34] file system.
diff --git a/tests/tail-2/inotify-rotate.sh b/tests/tail-2/inotify-rotate.sh
index 030d22a08..555c23cac 100755
--- a/tests/tail-2/inotify-rotate.sh
+++ b/tests/tail-2/inotify-rotate.sh
@@ -54,7 +54,7 @@ for i in $(seq 50); do
     rm -f k x out
 
     # Normally less than a second is required here, but with heavy load
-    # and a lot of disk activity, even 20 seconds is insufficient, which
+    # and a lot of file system activity, even 20 seconds is insufficient, which
     # leads to this timeout killing tail before the "ok" is written below.
     >k && >x || framework_failure_ failed to initialize files
     timeout 60 tail $fastpoll -F k > out 2>&1 & pid=$!
-- 
2.30.2