summaryrefslogtreecommitdiff
path: root/doc/coreutils.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/coreutils.texi')
-rw-r--r--doc/coreutils.texi1746
1 files changed, 1067 insertions, 679 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 767267bf..2c16dc48 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -1,7 +1,7 @@
\input texinfo
@c %**start of header
@setfilename coreutils.info
-@settitle @sc{gnu} Coreutils
+@settitle GNU Coreutils
@c %**end of header
@@ -40,8 +40,8 @@
* cat: (coreutils)cat invocation. Concatenate and write files.
* chcon: (coreutils)chcon invocation. Change SELinux CTX of files.
* chgrp: (coreutils)chgrp invocation. Change file groups.
-* chmod: (coreutils)chmod invocation. Change file permissions.
-* chown: (coreutils)chown invocation. Change file owners/groups.
+* chmod: (coreutils)chmod invocation. Change access permissions.
+* chown: (coreutils)chown invocation. Change file owners and groups.
* chroot: (coreutils)chroot invocation. Specify the root directory.
* cksum: (coreutils)cksum invocation. Print POSIX CRC checksum.
* comm: (coreutils)comm invocation. Compare sorted files by line.
@@ -85,6 +85,7 @@
* nl: (coreutils)nl invocation. Number lines and write files.
* nohup: (coreutils)nohup invocation. Immunize to hangups.
* nproc: (coreutils)nproc invocation. Print the number of processors.
+* numfmt: (coreutils)numfmt invocation. Reformat numbers.
* od: (coreutils)od invocation. Dump files in octal, etc.
* paste: (coreutils)paste invocation. Merge lines of files.
* pathchk: (coreutils)pathchk invocation. Check file name portability.
@@ -109,7 +110,6 @@
* stat: (coreutils)stat invocation. Report file(system) status.
* stdbuf: (coreutils)stdbuf invocation. Modify stdio buffering.
* stty: (coreutils)stty invocation. Print/change terminal settings.
-* su: (coreutils)su invocation. Modify user and group ID.
* sum: (coreutils)sum invocation. Print traditional checksum.
* sync: (coreutils)sync invocation. Synchronize memory and disk.
* tac: (coreutils)tac invocation. Reverse files.
@@ -137,10 +137,10 @@
@end direntry
@copying
-This manual documents version @value{VERSION} of the @sc{gnu} core
+This manual documents version @value{VERSION} of the GNU core
utilities, including the standard programs for text and file manipulation.
-Copyright @copyright{} 1994-2012 Free Software Foundation, Inc.
+Copyright @copyright{} 1994-2013 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -153,7 +153,7 @@ Free Documentation License''.
@end copying
@titlepage
-@title @sc{gnu} @code{Coreutils}
+@title GNU @code{Coreutils}
@subtitle Core GNU utilities
@subtitle for version @value{VERSION}, @value{UPDATED}
@author David MacKenzie et al.
@@ -200,7 +200,7 @@ Free Documentation License''.
* User information:: id logname whoami groups users who
* System context:: date arch nproc uname hostname hostid uptime
* SELinux context:: chcon runcon
-* Modified command invocation:: chroot env nice nohup stdbuf su timeout
+* Modified command invocation:: chroot env nice nohup stdbuf timeout
* Process control:: kill
* Delaying:: sleep
* Numeric operations:: factor seq
@@ -239,9 +239,12 @@ Output of entire files
Formatting file contents
* fmt invocation:: Reformat paragraph text
+* numfmt invocation:: Reformat numbers
* pr invocation:: Paginate or columnate files for printing
* fold invocation:: Wrap input lines to fit in specified width
+@command{numfmt}: General Options, Units
+
Output of parts of files
* head invocation:: Output the first part of files
@@ -273,7 +276,7 @@ Operating on sorted files
* Charset selection in ptx:: Underlying character set considerations
* Input processing in ptx:: Input fields, contexts, and keyword selection
* Output formatting in ptx:: Types of output format, and sizing the fields
-* Compatibility in ptx:: The @acronym{GNU} extensions to @command{ptx}
+* Compatibility in ptx:: The GNU extensions to @command{ptx}
Operating on fields
@@ -443,7 +446,6 @@ Modified command invocation
* nice invocation:: Run a command with modified niceness
* nohup invocation:: Run a command immune to hangups
* stdbuf invocation:: Run a command with modified I/O buffering
-* su invocation:: Run a command with substitute user and group ID
* timeout invocation:: Run a command with a time limit
Process control
@@ -471,13 +473,14 @@ Date input formats
* General date syntax:: Common rules
* Calendar date items:: 19 Dec 1994
* Time of day items:: 9:20pm
-* Time zone items:: @sc{est}, @sc{pdt}, @sc{gmt}
+* Time zone items:: EST, PDT, UTC, @dots{}
+* Combined date and time of day items:: 1972-09-24T20:02:00,000000-0500
* Day of week items:: Monday and others
* Relative items in date strings:: next tuesday, 2 years ago
* Pure numbers in date strings:: 19931219, 1440
* Seconds since the Epoch:: @@1078100502
* Specifying time zone rules:: TZ="America/New_York", TZ="UTC0"
-* Authors of parse_datetime:: Bellovin, Eggert, Salz, Berets, et al
+* Authors of parse_datetime:: Bellovin, Eggert, Salz, Berets, et al.
Opening the software toolbox
@@ -502,12 +505,12 @@ Copying This Manual
This manual is a work in progress: many sections make no attempt to explain
basic concepts in a way suitable for novices. Thus, if you are interested,
-please get involved in improving this manual. The entire @sc{gnu} community
+please get involved in improving this manual. The entire GNU community
will benefit.
-@cindex @acronym{POSIX}
-The @sc{gnu} utilities documented here are mostly compatible with the
-@acronym{POSIX} standard.
+@cindex POSIX
+The GNU utilities documented here are mostly compatible with the
+POSIX standard.
@cindex bugs, reporting
Please report bugs to @email{bug-coreutils@@gnu.org}. Remember
to include the version number, machine architecture, input files, and
@@ -585,15 +588,15 @@ symbolic link to a directory. @xref{Target directory}.
@opindex -0
@itemx --null
@opindex --null
-@cindex output @sc{nul}-byte-terminated lines
-Output a zero byte (@acronym{ASCII} @sc{nul}) at the end of each line,
-rather than a newline. This option enables other programs to parse the
+@cindex output NUL-byte-terminated lines
+Output a zero byte (ASCII NUL) at the end of each line,
+rather than a newline. This option enables other programs to parse the
output of @command{\cmd\} even when that output would contain data
with embedded newlines.
@end macro
@macro optSi
-@itemx --si
+@item --si
@opindex --si
@cindex SI output
Append an SI-style abbreviation to each size, such as @samp{M} for
@@ -617,7 +620,7 @@ Use the @option{--si} option if you prefer powers of 1000.
@end macro
@macro optStripTrailingSlashes
-@itemx @w{@kbd{--strip-trailing-slashes}}
+@item @w{@kbd{--strip-trailing-slashes}}
@opindex --strip-trailing-slashes
@cindex stripping trailing slashes
Remove any trailing slashes from each @var{source} argument.
@@ -669,7 +672,7 @@ and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.
Certain options are available in all of these programs. Rather than
writing identical descriptions for each of the programs, they are
-described here. (In fact, every @sc{gnu} program accepts (or should accept)
+described here. (In fact, every GNU program accepts (or should accept)
these options.)
@vindex POSIXLY_CORRECT
@@ -741,7 +744,7 @@ name.
* Traversing symlinks:: -H, -L, or -P, in some programs.
* Treating / specially:: --preserve-root and --no-preserve-root.
* Special built-in utilities:: @command{break}, @command{:}, @dots{}
-* Standards conformance:: Conformance to the @acronym{POSIX} standard.
+* Standards conformance:: Conformance to the POSIX standard.
@end menu
@@ -757,7 +760,7 @@ Nearly every command invocation yields an integral @dfn{exit status}
that can be used to change how other commands work.
For the vast majority of commands, an exit status of zero indicates
success. Failure is indicated by a nonzero value---typically
-@samp{1}, though it may differ on unusual platforms as @acronym{POSIX}
+@samp{1}, though it may differ on unusual platforms as POSIX
requires only that it be nonzero.
However, some of the programs documented here do produce
@@ -765,8 +768,8 @@ other exit status values and a few associate different
meanings with the values @samp{0} and @samp{1}.
Here are some of the exceptions:
@command{chroot}, @command{env}, @command{expr}, @command{nice},
-@command{nohup}, @command{printenv}, @command{sort}, @command{stdbuf},
-@command{su}, @command{test}, @command{timeout}, @command{tty}.
+@command{nohup}, @command{numfmt}, @command{printenv}, @command{sort},
+@command{stdbuf}, @command{test}, @command{timeout}, @command{tty}.
@node Backup options
@@ -774,7 +777,7 @@ Here are some of the exceptions:
@cindex backup options
-Some @sc{gnu} programs (at least @command{cp}, @command{install},
+Some GNU programs (at least @command{cp}, @command{install},
@command{ln}, and @command{mv}) optionally make backups of files
before writing new versions.
These options control the details of these backups. The options are also
@@ -848,7 +851,7 @@ set, the default is @samp{~}, just as in Emacs.
@cindex block size
-Some @sc{gnu} programs (at least @command{df}, @command{du}, and
+Some GNU programs (at least @command{df}, @command{du}, and
@command{ls}) display sizes in ``blocks''. You can adjust the block size
and method of display to make sizes easier to read. The block size
used for display is independent of any file system block size.
@@ -949,7 +952,7 @@ kilobyte: @math{10^3 = 1000}.
@cindex kibibyte, definition of
kibibyte: @math{2^{10} = 1024}. @samp{K} is special: the SI prefix is
@samp{k} and the ISO/IEC 80000-13 prefix is @samp{Ki}, but tradition and
-@acronym{POSIX} use @samp{k} to mean @samp{KiB}.
+POSIX use @samp{k} to mean @samp{KiB}.
@item MB
@cindex megabyte, definition of
megabyte: @math{10^6 = 1,000,000}.
@@ -1048,8 +1051,8 @@ floating point numbers such as @code{-0x.ep-3}, which stands for
A @var{signal} may be a signal name like @samp{HUP}, or a signal
number like @samp{1}, or an exit status of a process terminated by the
signal. A signal name can be given in canonical form or prefixed by
-@samp{SIG}. The case of the letters is ignored. The following signal names
-and numbers are supported on all @acronym{POSIX} compliant systems:
+@samp{SIG}@. The case of the letters is ignored. The following signal names
+and numbers are supported on all POSIX compliant systems:
@table @samp
@item HUP
@@ -1070,7 +1073,7 @@ and numbers are supported on all @acronym{POSIX} compliant systems:
@noindent
Other supported signal names have system-dependent corresponding
-numbers. All systems conforming to @acronym{POSIX} 1003.1-2001 also
+numbers. All systems conforming to POSIX 1003.1-2001 also
support the following signals:
@table @samp
@@ -1105,7 +1108,7 @@ User-defined signal 2.
@end table
@noindent
-@acronym{POSIX} 1003.1-2001 systems that support the @acronym{XSI} extension
+POSIX 1003.1-2001 systems that support the XSI extension
also support the following signals:
@table @samp
@@ -1126,7 +1129,7 @@ File size limit exceeded.
@end table
@noindent
-@acronym{POSIX} 1003.1-2001 systems that support the @acronym{XRT} extension
+POSIX 1003.1-2001 systems that support the XRT extension
also support at least eight real-time signals called @samp{RTMIN},
@samp{RTMIN+1}, @dots{}, @samp{RTMAX-1}, @samp{RTMAX}.
@@ -1143,10 +1146,10 @@ Since the @var{owner} and @var{group} arguments to @command{chown} and
apparent ambiguity.
What if a user or group @emph{name} is a string of digits?
@footnote{Using a number as a user name is common in some environments.}
-Should the command interpret it as a user name or as an ID?
-@acronym{POSIX} requires that @command{chown} and @command{chgrp}
+Should the command interpret it as a user name or as an ID@?
+POSIX requires that @command{chown} and @command{chgrp}
first attempt to resolve the specified string as a name, and
-only once that fails, then try to interpret it as an ID.
+only once that fails, then try to interpret it as an ID@.
This is troublesome when you want to specify a numeric ID, say 42,
and it must work even in a pathological situation where
@samp{42} is a user name that maps to some other user ID, say 1000.
@@ -1272,7 +1275,7 @@ ls | xargs mv -t ../d --
@end smallexample
However, this doesn't move files whose names begin with @samp{.}.
-If you use the @sc{gnu} @command{find} program, you can move those
+If you use the GNU @command{find} program, you can move those
files too, with this command:
@example
@@ -1284,7 +1287,7 @@ But both of the above approaches fail if there are no files in the
current directory, or if any file has a name containing a blank or
some other special characters.
The following example removes those limitations and requires both
-@sc{gnu} @command{find} and @sc{gnu} @command{xargs}:
+GNU @command{find} and GNU @command{xargs}:
@example
find . -mindepth 1 -maxdepth 1 -print0 \
@@ -1304,7 +1307,7 @@ options cannot be combined.
@cindex trailing slashes
-Some @sc{gnu} programs (at least @command{cp} and @command{mv}) allow you to
+Some GNU programs (at least @command{cp} and @command{mv}) allow you to
remove any trailing slashes from each @var{source} argument before
operating on it. The @w{@kbd{--strip-trailing-slashes}} option enables
this behavior.
@@ -1318,7 +1321,7 @@ option, @command{mv}, for example, (via the system's rename function) must
interpret a trailing slash as a request to dereference the symbolic link
and so must rename the indirectly referenced @emph{directory} and not
the symbolic link. Although it may seem surprising that such behavior
-be the default, it is required by @acronym{POSIX} and is consistent with
+be the default, it is required by POSIX and is consistent with
other parts of that standard.
@node Traversing symlinks
@@ -1382,11 +1385,11 @@ For example, if a user with appropriate privileges mistakenly runs
@samp{rm -rf / tmp/junk}, that may remove
all files on the entire system. Since there are so few
legitimate uses for such a command,
-@sc{gnu} @command{rm} normally declines to operate on any directory
+GNU @command{rm} normally declines to operate on any directory
that resolves to @file{/}. If you really want to try to remove all
the files on your system, you can use the @option{--no-preserve-root}
option, but the default behavior, specified by the
-@option{--preserve-option}, is safer for most purposes.
+@option{--preserve-root} option, is safer for most purposes.
The commands @command{chgrp}, @command{chmod} and @command{chown}
can also operate destructively on entire hierarchies, so they too
@@ -1394,7 +1397,7 @@ support these options. Although, unlike @command{rm}, they don't
actually unlink files, these commands are arguably more dangerous
when operating recursively on @file{/}, since they often work much
more quickly, and hence damage more files before an alert user can
-interrupt them. Tradition and @acronym{POSIX} require these commands
+interrupt them. Tradition and POSIX require these commands
to operate recursively on @file{/}, so they default to
@option{--no-preserve-root}, but using the @option{--preserve-root}
option makes them safer for most purposes. For convenience you can
@@ -1416,7 +1419,7 @@ well-defined behavior: it may generate an error message instead of
exiting.
Here is a list of the special built-in utilities that are standardized
-by @acronym{POSIX} 1003.1-2004.
+by POSIX 1003.1-2004.
@quotation
@t{.@: : break continue eval exec exit export readonly
@@ -1436,31 +1439,31 @@ generates an error message instead of suspending.
@section Standards conformance
@vindex POSIXLY_CORRECT
-In a few cases, the @sc{gnu} utilities' default behavior is
-incompatible with the @acronym{POSIX} standard. To suppress these
+In a few cases, the GNU utilities' default behavior is
+incompatible with the POSIX standard. To suppress these
incompatibilities, define the @env{POSIXLY_CORRECT} environment
-variable. Unless you are checking for @acronym{POSIX} conformance, you
+variable. Unless you are checking for POSIX conformance, you
probably do not need to define @env{POSIXLY_CORRECT}.
-Newer versions of @acronym{POSIX} are occasionally incompatible with older
-versions. For example, older versions of @acronym{POSIX} required the
+Newer versions of POSIX are occasionally incompatible with older
+versions. For example, older versions of POSIX required the
command @samp{sort +1} to sort based on the second and succeeding
-fields in each input line, but starting with @acronym{POSIX} 1003.1-2001
+fields in each input line, but starting with POSIX 1003.1-2001
the same command is required to sort the file named @file{+1}, and you
must instead use the command @samp{sort -k 2} to get the field-based
sort.
@vindex _POSIX2_VERSION
-The @sc{gnu} utilities normally conform to the version of @acronym{POSIX}
+The GNU utilities normally conform to the version of POSIX
that is standard for your system. To cause them to conform to a
-different version of @acronym{POSIX}, define the @env{_POSIX2_VERSION}
+different version of POSIX, define the @env{_POSIX2_VERSION}
environment variable to a value of the form @var{yyyymm} specifying
the year and month the standard was adopted. Three values are currently
supported for @env{_POSIX2_VERSION}: @samp{199209} stands for
-@acronym{POSIX} 1003.2-1992, @samp{200112} stands for @acronym{POSIX}
-1003.1-2001, and @samp{200809} stands for @acronym{POSIX} 1003.1-2008.
+POSIX 1003.2-1992, @samp{200112} stands for POSIX
+1003.1-2001, and @samp{200809} stands for POSIX 1003.1-2008.
For example, if you have a newer system but are running software
-that assumes an older version of @acronym{POSIX} and uses @samp{sort +1}
+that assumes an older version of POSIX and uses @samp{sort +1}
or @samp{tail +10}, you can work around any compatibility problems by setting
@samp{_POSIX2_VERSION=199209} in your environment.
@@ -1548,7 +1551,7 @@ Display TAB characters as @samp{^I}.
@item -u
@opindex -u
-Ignored; for @acronym{POSIX} compatibility.
+Ignored; for POSIX compatibility.
@item -v
@itemx --show-nonprinting
@@ -1614,10 +1617,7 @@ precedes in the file.
@itemx --regex
@opindex -r
@opindex --regex
-Treat the separator string as a regular expression. Users of @command{tac}
-on MS-DOS/MS-Windows should note that, since @command{tac} reads files in
-binary mode, each line of a text file might end with a CR/LF pair
-instead of the Unix-style LF.
+Treat the separator string as a regular expression.
@item -s @var{separator}
@itemx --separator=@var{separator}
@@ -1627,8 +1627,18 @@ Use @var{separator} as the record separator, instead of newline.
@end table
+On systems like MS-DOS that distinguish between text and binary files,
+@command{tac} reads and writes in binary mode.
+
@exitstatus
+Example:
+
+@example
+# Reverse a file character by character.
+tac -r -s 'x\|[^x]'
+@end example
+
@node nl invocation
@section @command{nl}: Number lines and write files
@@ -1881,12 +1891,12 @@ Output at most @var{bytes} bytes of the input. Prefixes and suffixes on
@opindex --strings
@cindex string constants, outputting
Instead of the normal output, output only @dfn{string constants}: at
-least @var{bytes} consecutive @acronym{ASCII} graphic characters,
-followed by a zero byte (@acronym{ASCII} @sc{nul}).
+least @var{bytes} consecutive ASCII graphic characters,
+followed by a zero byte (ASCII NUL).
Prefixes and suffixes on @var{bytes} are interpreted as for the
@option{-j} option.
-If @var{n} is omitted with @option{--strings}, the default is 3.
+If @var{bytes} is omitted with @option{--strings}, the default is 3.
@item -t @var{type}
@itemx --format=@var{type}
@@ -1900,14 +1910,14 @@ of each output line using each of the data types that you specified,
in the order that you specified.
Adding a trailing ``z'' to any type specification appends a display
-of the @acronym{ASCII} character representation of the printable characters
+of the ASCII character representation of the printable characters
to the output line generated by the type specification.
@table @samp
@item a
named character, ignoring high-order bit
@item c
-@acronym{ASCII} character or backslash escape,
+ASCII character or backslash escape,
@item d
signed decimal
@item f
@@ -1980,7 +1990,7 @@ omitted, the default is 32.
@end table
The next several options are shorthands for format specifications.
-@sc{gnu} @command{od} accepts any combination of shorthands and format
+GNU @command{od} accepts any combination of shorthands and format
specification options. These options accumulate.
@table @samp
@@ -1995,7 +2005,7 @@ Output as octal bytes. Equivalent to @samp{-t o1}.
@item -c
@opindex -c
-Output as @acronym{ASCII} characters or backslash escapes. Equivalent to
+Output as ASCII characters or backslash escapes. Equivalent to
@samp{-t c}.
@item -d
@@ -2055,7 +2065,7 @@ address.
@command{base64} transforms data read from a file, or standard input,
into (or from) base64 encoded form. The base64 encoded form uses
-printable @acronym{ASCII} characters to represent binary data.
+printable ASCII characters to represent binary data.
Synopses:
@smallexample
@@ -2116,6 +2126,7 @@ These commands reformat the contents of files.
@menu
* fmt invocation:: Reformat paragraph text.
+* numfmt invocation:: Reformat numbers.
* pr invocation:: Paginate or columnate files for printing.
* fold invocation:: Wrap input lines to fit in specified width.
@end menu
@@ -2206,7 +2217,7 @@ between sentences to two spaces.
Fill output lines up to @var{width} characters (default 75 or @var{goal}
plus 10, if @var{goal} is provided).
-@itemx -g @var{goal}
+@item -g @var{goal}
@itemx --goal=@var{goal}
@opindex -g
@opindex --goal
@@ -2225,6 +2236,325 @@ leaving the code unchanged.
@exitstatus
+@node numfmt invocation
+@section @command{numfmt}: Reformat numbers
+
+@pindex numfmt
+
+@command{numfmt} reads numbers in various representations and reformats them
+as requested. The most common usage is converting numbers to/from @emph{human}
+representation (e.g. @samp{4G} @expansion{} @samp{4,000,000,000}).
+
+@example
+numfmt [@var{option}]@dots{} [@var{number}]
+@end example
+
+@command{numfmt} converts each @var{number} on the command-line according to the
+specified options (see below). If no @var{number}s are given, it reads numbers
+from standard input. @command{numfmt} can optionally extract numbers from
+specific columns, maintaining proper line padding and alignment.
+
+@exitstatus
+
+See @option{--invalid} for additional information regarding exit status.
+
+@subsection General options
+
+The program accepts the following options. Also see @ref{Common options}.
+
+@table @samp
+
+@item --debug
+@opindex --debug
+Print (to standard error) warning messages about possible erroneous usage.
+
+@item -d @var{d}
+@itemx --delimiter=@var{d}
+@opindex -d
+@opindex --delimiter
+Use the character @var{d} as input field separator (default: whitespace).
+@emph{Note}: Using non-default delimiter turns off automatic padding.
+
+@item --field=@var{n}
+@opindex --field
+Convert the number in input field @var{n} (default: 1).
+
+@item --format=@var{format}
+@opindex --format
+Use printf-style floating FORMAT string. The @var{format} string must contain
+one @samp{%f} directive, optionally with @samp{'}, @samp{-}, or width
+modifiers. The @samp{'} modifier will enable @option{--grouping}, the @samp{-}
+modifier will enable left-aligned @option{--padding} and the width modifier will
+enable right-aligned @option{--padding}.
+
+@item --from=@var{unit}
+@opindex --from
+Auto-scales input numbers according to @var{unit}. See UNITS below.
+The default is no scaling, meaning suffixes (e.g. @samp{M}, @samp{G}) will
+trigger an error.
+
+@item --from-unit=@var{n}
+@opindex --from-unit
+Specify the input unit size (instead of the default 1). Use this option when
+the input numbers represent other units (e.g. if the input number @samp{10}
+represents 10 units of 512 bytes, use @samp{--from=unit=512}).
+
+@item --grouping
+@opindex --grouping
+Group digits in output numbers according to the current locale's grouping rules
+(e.g @emph{Thousands Separator} character, commonly @samp{.} (dot) or @samp{,}
+comma). This option has no effect in @samp{POSIX/C} locale.
+
+@item --header[=@var{n}]
+@opindex --header
+@opindex --header=N
+Print the first @var{n} (default: 1) lines without any conversion.
+
+@item --invalid=@var{mode}
+@opindex --invalid
+The default action on input errors is to exit immediately with status code 2.
+@option{--invalid=@samp{abort}} explicitly specifies this default mode.
+With a @var{mode} of @samp{fail}, print a warning for @emph{each} conversion
+error, and exit with status 2. With a @var{mode} of @samp{warn}, exit with
+status 0, even in the presence of conversion errors, and with a @var{mode} of
+@samp{ignore} do not even print diagnostics.
+
+@item --padding=@var{n}
+@opindex --padding
+Pad the output numbers to @var{n} characters, by adding spaces. If @var{n} is
+a positive number, numbers will be right-aligned. If @var{n} is a negative
+number, numbers will be left-aligned. By default, numbers are automatically
+aligned based on the input line's width (only with the default delimiter).
+
+@item --round=@var{method}
+@opindex --round
+@opindex --round=up
+@opindex --round=down
+@opindex --round=from-zero
+@opindex --round=towards-zero
+@opindex --round=nearest
+When converting number representations, round the number according to
+@var{method}, which can be @samp{up}, @samp{down},
+@samp{from-zero} (the default), @samp{towards-zero}, @samp{nearest}.
+
+@item --suffix=@var{suffix}
+@opindex --suffix
+Add @samp{SUFFIX} to the output numbers, and accept optional @samp{SUFFIX} in
+input numbers.
+
+@item --to=@var{unit}
+@opindex --to
+Auto-scales output numbers according to @var{unit}. See @emph{Units} below.
+The default is no scaling, meaning all the digits of the number are printed.
+
+@item --to-unit=@var{n}
+@opindex --to-unit
+Specify the output unit size (instead of the default 1). Use this option when
+the output numbers represent other units (e.g. to represent @samp{4,000,000}
+bytes in blocks of 1KB, use @samp{--to=si --to=units=1000}).
+
+@end table
+
+@subsection Possible @var{unit}s:
+
+The following are the possible @var{unit} options with @option{--from=UNITS} and
+@option{--to=UNITS}:
+
+@table @var
+
+@item none
+No scaling is performed. For input numbers, no suffixes are accepted, and any
+trailing characters following the number will trigger an error. For output
+numbers, all digits of the numbers will be printed.
+
+@item si
+Auto-scale numbers according to the @emph{International System of Units (SI)}
+standard.
+For input numbers, accept one of the following suffixes.
+For output numbers, values larger than 1000 will be rounded, and printed with
+one of the following suffixes:
+
+@example
+@samp{K} => @math{1000^1 = 10^3} (Kilo)
+@samp{M} => @math{1000^2 = 10^6} (Mega)
+@samp{G} => @math{1000^3 = 10^9} (Giga)
+@samp{T} => @math{1000^4 = 10^{12}} (Tera)
+@samp{P} => @math{1000^5 = 10^{15}} (Peta)
+@samp{E} => @math{1000^6 = 10^{18}} (Exa)
+@samp{Z} => @math{1000^7 = 10^{21}} (Zetta)
+@samp{Y} => @math{1000^8 = 10^{24}} (Yotta)
+@end example
+
+@item iec
+Auto-scale numbers according to the @emph{International Electronical
+Commission (IEC)} standard.
+For input numbers, accept one of the following suffixes.
+For output numbers, values larger than 1024 will be rounded, and printed with
+one of the following suffixes:
+
+@example
+@samp{K} => @math{1024^1 = 2^{10}} (Kibi)
+@samp{M} => @math{1024^2 = 2^{20}} (Mebi)
+@samp{G} => @math{1024^3 = 2^{30}} (Gibi)
+@samp{T} => @math{1024^4 = 2^{40}} (Tebi)
+@samp{P} => @math{1024^5 = 2^{50}} (Pebi)
+@samp{E} => @math{1024^6 = 2^{60}} (Exbi)
+@samp{Z} => @math{1024^7 = 2^{70}} (Zebi)
+@samp{Y} => @math{1024^8 = 2^{80}} (Yobi)
+@end example
+
+The @option{iec} option uses a single letter suffix (e.g. @samp{G}), which is
+not fully standard, as the @emph{iec} standard recommends a two-letter symbol
+(e.g @samp{Gi}) - but in practice, this method common. Compare with
+the @option{iec-i} option.
+
+@item iec-i
+Auto-scale numbers according to the @emph{International Electronical
+Commission (IEC)} standard.
+For input numbers, accept one of the following suffixes.
+For output numbers, values larger than 1024 will be rounded, and printed with
+one of the following suffixes:
+
+@example
+@samp{Ki} => @math{1024^1 = 2^{10}} (Kibi)
+@samp{Mi} => @math{1024^2 = 2^{20}} (Mebi)
+@samp{Gi} => @math{1024^3 = 2^{30}} (Gibi)
+@samp{Ti} => @math{1024^4 = 2^{40}} (Tebi)
+@samp{Pi} => @math{1024^5 = 2^{50}} (Pebi)
+@samp{Ei} => @math{1024^6 = 2^{60}} (Exbi)
+@samp{Zi} => @math{1024^7 = 2^{70}} (Zebi)
+@samp{Yi} => @math{1024^8 = 2^{80}} (Yobi)
+@end example
+
+The @option{iec-i} option uses a two-letter suffix symbol (e.g. @samp{Gi}),
+as the @emph{iec} standard recommends, but this is not always common in
+practice. Compare with the @option{iec} option.
+
+@item auto
+@samp{auto} can only be used with @option{--from}. With this method, numbers
+with @samp{K},@samp{M},@samp{G},@samp{T},@samp{P},@samp{E},@samp{Z},@samp{Y}
+suffixes are interpreted as @emph{SI} values, and numbers with @samp{Ki},
+@samp{Mi},@samp{Gi},@samp{Ti},@samp{Pi},@samp{Ei},@samp{Zi},@samp{Yi} suffixes
+are interpreted as @emph{IEC} values.
+
+@end table
+
+@subsection Examples of using @command{numfmt}
+
+Converting a single number from/to @emph{human} representation:
+@example
+$ nunfmt --to=si 500000
+500K
+
+$ numfmt --to=iec 500000
+489K
+
+$ numfmt --to=iec-i 500000
+489Ki
+
+$ numfmt --from=si 1M
+1000000
+
+$ numfmt --from=iec 1M
+1048576
+
+# with '--from=auto', M=Mega, Mi=Mebi
+$ numfmt --from=auto 1M
+1000000
+$ numfmt --from=auto 1Mi
+1048576
+@end example
+
+Converting from @samp{SI} to @samp{IEC} scales (e.g. when a harddisk capacity is
+advertised as @samp{1TB}, while checking the drive's capacity gives lower
+values):
+
+@example
+$ numfmt --from=si --to=iec 1T
+932G
+@end example
+
+
+Converting a single field from an input file / piped input (these contrived
+examples are for demonstration purposes only, as both @command{ls} and
+@command{df} support the @option{--human-readable} option to
+output sizes in human-readable format):
+
+@example
+# Third field (file size) will be shown in SI representation
+$ ls -log | numfmt --field 3 --header --to=si | head -n4
+-rw-r--r-- 1 94K Aug 23 2011 ABOUT-NLS
+-rw-r--r-- 1 3.7K Jan 7 16:15 AUTHORS
+-rw-r--r-- 1 36K Jun 1 2011 COPYING
+-rw-r--r-- 1 0 Jan 7 15:15 ChangeLog
+
+# Second field (size) will be shown in IEC representation
+$ df --block-size=1 | numfmt --field 2 --header --to=iec | head -n4
+File system 1B-blocks Used Available Use% Mounted on
+rootfs 132G 104741408 26554036 80% /
+tmpfs 794M 7580 804960 1% /run/shm
+/dev/sdb1 694G 651424756 46074696 94% /home
+@end example
+
+
+Output can be tweaked using @option{--padding} or @option{--format}:
+
+@example
+# Pad to 10 characters, right-aligned
+$ du -s * | numfmt --to=si --padding=10
+ 2.5K config.log
+ 108 config.status
+ 1.7K configure
+ 20 configure.ac
+
+# Pad to 10 characters, left-aligned
+$ du -s * | numfmt --to=si --padding=-10
+2.5K config.log
+108 config.status
+1.7K configure
+20 configure.ac
+
+# Pad to 10 characters, left-aligned, using 'format'
+$ du -s * | numfmt --to=si --format="%10f"
+ 2.5K config.log
+ 108 config.status
+ 1.7K configure
+ 20 configure.ac
+
+# Pad to 10 characters, left-aligned, using 'format'
+$ du -s * | numfmt --to=si --padding="%-10f"
+2.5K config.log
+108 config.status
+1.7K configure
+20 configure.ac
+@end example
+
+With locales that support grouping digits, using @option{--grouping} or
+@option{--format} enables grouping. In @samp{POSIX} locale, grouping is
+silently ignored:
+
+@example
+$ LC_ALL=C numfmt --from=iec --grouping 2G
+2147483648
+
+$ LC_ALL=en_US.utf8 numfmt --from=iec --grouping 2G
+2,147,483,648
+
+$ LC_ALL=ta_IN numfmt --from=iec --grouping 2G
+2,14,74,83,648
+
+$ LC_ALL=C ./src/numfmt --from=iec --format="==%'15f==" 2G
+== 2147483648==
+
+$ LC_ALL=en_US.utf8 ./src/numfmt --from=iec --format="==%'15f==" 2G
+== 2,147,483,648==
+
+$ LC_ALL=en_US.utf8 ./src/numfmt --from=iec --format="==%'-15f==" 2G
+==2,147,483,648 ==
+
+$ LC_ALL=ta_IN ./src/numfmt --from=iec --format="==%'15f==" 2G
+== 2,14,74,83,648==
+@end example
@node pr invocation
@section @command{pr}: Paginate or columnate files for printing
@@ -2269,36 +2599,6 @@ For single
column output no line truncation occurs by default. Use @option{-W} option to
truncate lines in that case.
-The following changes were made in version 1.22i and apply to later
-versions of @command{pr}:
-@c FIXME: this whole section here sounds very awkward to me. I
-@c made a few small changes, but really it all needs to be redone. - Brian
-@c OK, I fixed another sentence or two, but some of it I just don't understand.
-@ - Brian
-@itemize @bullet
-
-@item
-Some small @var{letter options} (@option{-s}, @option{-w}) have been
-redefined for better @acronym{POSIX} compliance. The output of some further
-cases has been adapted to other Unix systems. These changes are not
-compatible with earlier versions of the program.
-
-@item
-Some @var{new capital letter} options (@option{-J}, @option{-S}, @option{-W})
-have been introduced to turn off unexpected interferences of small letter
-options. The @option{-N} option and the second argument @var{last_page}
-of @samp{+FIRST_PAGE} offer more flexibility. The detailed handling of
-form feeds set in the input files requires the @option{-T} option.
-
-@item
-Capital letter options override small letter ones.
-
-@item
-Some of the option-arguments (compare @option{-s}, @option{-e},
-@option{-i}, @option{-n}) cannot be specified as separate arguments from the
-preceding option letter (already stated in the @acronym{POSIX} specification).
-@end itemize
-
The program accepts the following options. Also see @ref{Common options}.
@table @samp
@@ -2377,7 +2677,7 @@ e.g., @option{--date-format="Monday morning"}.
The default date format is @samp{%Y-%m-%d %H:%M} (for example,
@samp{2001-12-04 23:59});
but if the @env{POSIXLY_CORRECT} environment variable is set
-and the @env{LC_TIME} locale category specifies the @acronym{POSIX}
+and the @env{LC_TIME} locale category specifies the POSIX
locale, the default is @samp{%b %e %H:%M %Y} (for example,
@samp{Dec@ @ 4 23:59 2001}.
@@ -2434,7 +2734,7 @@ Merge lines of full length. Used together with the column options
no column alignment used; may be used with
@option{--sep-string[=@var{string}]}. @option{-J} has been introduced
(together with @option{-W} and @option{--sep-string})
-to disentangle the old (@acronym{POSIX}-compliant) options @option{-w} and
+to disentangle the old (POSIX-compliant) options @option{-w} and
@option{-s} along with the three column options.
@@ -2480,11 +2780,11 @@ separator is the TAB character. In a strict sense a TAB is always
printed with single column output only. The TAB width varies
with the TAB position, e.g., with the left @var{margin} specified
by @option{-o} option. With multicolumn output priority is given to
-@samp{equal width of output columns} (a @acronym{POSIX} specification).
+@samp{equal width of output columns} (a POSIX specification).
The TAB width is fixed to the value of the first column and does
not change with different values of left @var{margin}. That means a
fixed number of spaces is always printed in the place of the
-@var{number-separator} TAB. The tabification depends upon the output
+@var{number-separator} TAB@. The tabification depends upon the output
position.
@item -N @var{line_number}
@@ -2521,7 +2821,7 @@ Separate columns by a single character @var{char}. The default for
character} with @option{-w}. Without @option{-s} the default separator
@samp{space} is set. @option{-s[char]} turns off line truncation of all
three column options (@option{-COLUMN}|@option{-a -COLUMN}|@option{-m}) unless
-@option{-w} is set. This is a @acronym{POSIX}-compliant formulation.
+@option{-w} is set. This is a POSIX-compliant formulation.
@item -S[@var{string}]
@@ -2571,7 +2871,7 @@ output only (default for @var{page_width} is 72). @option{-s[CHAR]} turns
off the default page width and any line truncation and column alignment.
Lines of full length are merged, regardless of the column options
set. No @var{page_width} setting is possible with single column output.
-A @acronym{POSIX}-compliant formulation.
+A POSIX-compliant formulation.
@item -W @var{page_width}
@itemx --page_width=@var{page_width}
@@ -2585,7 +2885,7 @@ alignment is always used. The separator options @option{-S} or @option{-s}
don't affect the @option{-W} option. Default is 72 characters. Without
@option{-W @var{page_width}} and without any of the column options NO line
truncation is used (defined to keep downward compatibility and to meet
-most frequent tasks). That's equivalent to @option{-W 72 -J}. The header
+most frequent tasks). That's equivalent to @option{-W 72 -J}@. The header
line is never truncated.
@end table
@@ -2704,7 +3004,7 @@ However, if @var{k} starts with a @samp{-},
print all but the last @var{k} bytes of each file.
@multiplierSuffixes{k}
-@itemx -n @var{k}
+@item -n @var{k}
@itemx --lines=@var{k}
@opindex -n
@opindex --lines
@@ -2768,13 +3068,13 @@ one-line header consisting of:
before the output for each @var{file}.
@cindex BSD @command{tail}
-@sc{gnu} @command{tail} can output any amount of data (some other versions of
+GNU @command{tail} can output any amount of data (some other versions of
@command{tail} cannot). It also has no @option{-r} option (print in
reverse), since reversing a file is really a different job from printing
the end of a file; BSD @command{tail} (which is the one with @option{-r}) can
only reverse files that are at most as large as its buffer, which is
typically 32 KiB@. A more reliable and versatile way to reverse files is
-the @sc{gnu} @command{tac} command.
+the GNU @command{tac} command.
The program accepts the following options. Also see @ref{Common options}.
@@ -2854,7 +3154,7 @@ This option is the same as @option{--follow=name --retry}. That is, tail
will attempt to reopen a file when it is removed. Should this fail, tail
will keep trying until it becomes accessible again.
-@itemx --retry
+@item --retry
@opindex --retry
This option is useful mainly when following by name (i.e., with
@option{--follow=name}).
@@ -2862,7 +3162,7 @@ Without this option, when tail encounters a file that doesn't
exist or is otherwise inaccessible, it reports that fact and
never checks it again.
-@itemx --sleep-interval=@var{number}
+@item --sleep-interval=@var{number}
@opindex --sleep-interval
Change the number of seconds to wait between iterations (the default is 1.0).
During one iteration, every specified file is checked to see if it has
@@ -2875,7 +3175,7 @@ is usually ignored. However, if you also specify @option{--pid=@var{p}},
@command{tail} checks whether process @var{p} is alive at least
every @var{number} seconds.
-@itemx --pid=@var{pid}
+@item --pid=@var{pid}
@opindex --pid
When following by name or by descriptor, you may specify the process ID,
@var{pid}, of the sole writer of all @var{file} arguments. Then, shortly
@@ -2898,7 +3198,7 @@ terminate until long after the real writer has terminated.
Note that @option{--pid} cannot be supported on some systems; @command{tail}
will print a warning if this is the case.
-@itemx --max-unchanged-stats=@var{n}
+@item --max-unchanged-stats=@var{n}
@opindex --max-unchanged-stats
When tailing a file by name, if there have been @var{n} (default
n=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive
@@ -2911,7 +3211,7 @@ and when it prints the lines that have accumulated in the new log file.
This option is meaningful only when polling (i.e., without inotify)
and when following by name.
-@itemx -n @var{k}
+@item -n @var{k}
@itemx --lines=@var{k}
@opindex -n
@opindex --lines
@@ -2963,7 +3263,7 @@ can use a test like @samp{if tail -c +1 </dev/null >/dev/null 2>&1;
then @dots{}} to decide which syntax to use.
Even if your script assumes the standard behavior, you should still
-beware usages whose behaviors differ depending on the @acronym{POSIX}
+beware usages whose behaviors differ depending on the POSIX
version. For example, avoid @samp{tail - main.c}, since it might be
interpreted as either @samp{tail main.c} or as @samp{tail -- -
main.c}; avoid @samp{tail -c 4}, since it might mean either @samp{tail
@@ -3036,7 +3336,7 @@ possible without exceeding @var{size} bytes. Individual lines longer than
@var{size} bytes are broken into multiple files.
@var{size} has the same format as for the @option{--bytes} option.
-@itemx --filter=@var{command}
+@item --filter=@var{command}
@opindex --filter
With this option, rather than simply writing to each output file,
write through a pipe to the specified shell @var{command} for each output file.
@@ -3110,9 +3410,9 @@ Note specifying a @var{from} value also disables the default
auto suffix length expansion described above, and so you may also
want to specify @option{-a} to allow suffixes beyond @samp{99}.
-@itemx --additional-suffix=@var{suffix}
+@item --additional-suffix=@var{suffix}
@opindex --additional-suffix
-Append an additional @var{suffix} to output file names. @var{suffix}
+Append an additional @var{suffix} to output file names. @var{suffix}
must not contain slash.
@item -e
@@ -3129,10 +3429,10 @@ even when this option is specified.
@itemx --unbuffered
@opindex -u
@opindex --unbuffered
-Immediately copy input to output in @option{--number r/...} mode,
+Immediately copy input to output in @option{--number r/@dots{}} mode,
which is a much slower mode of operation.
-@itemx --verbose
+@item --verbose
@opindex --verbose
Write a diagnostic just before each output file is opened.
@@ -3430,7 +3730,7 @@ Each count is printed right-justified in a field with at least one
space between fields so that the numbers and file names normally line
up nicely in columns. The width of the count fields varies depending
on the inputs, so you should not depend on a particular field width.
-However, as a @acronym{GNU} extension, if only one count is printed,
+However, as a GNU extension, if only one count is printed,
it is guaranteed to be printed without leading spaces.
By default, @command{wc} prints three counts: the newline, words, and byte
@@ -3485,24 +3785,24 @@ Print only the newline counts.
Print only the maximum line lengths.
@macro filesZeroFromOption{cmd,withTotalOption,subListOutput}
-@itemx --files0-from=@var{file}
+@item --files0-from=@var{file}
@opindex --files0-from=@var{file}
@c This is commented out to avoid a texi2dvi failure.
@c texi2dvi (GNU Texinfo 4.11) 1.104
@c @cindex including files from @command{\cmd\}
Disallow processing files named on the command line, and instead process
those named in file @var{file}; each name being terminated by a zero byte
-(@acronym{ASCII} @sc{nul}).
+(ASCII NUL).
This is useful \withTotalOption\
when the list of file names is so long that it may exceed a command line
length limitation.
In such cases, running @command{\cmd\} via @command{xargs} is undesirable
because it splits the list into pieces and makes @command{\cmd\} print
\subListOutput\ for each sublist rather than for the entire list.
-One way to produce a list of @acronym{ASCII} @sc{nul} terminated file
-names is with @sc{gnu}
+One way to produce a list of ASCII NUL terminated file
+names is with GNU
@command{find}, using its @option{-print0} predicate.
-If @var{file} is @samp{-} then the @acronym{ASCII} @sc{nul} terminated
+If @var{file} is @samp{-} then the ASCII NUL terminated
file names are read from standard input.
@end macro
@filesZeroFromOption{wc,,a total}
@@ -3540,7 +3840,7 @@ is given, file names are also printed (by default). (With the
@option{--sysv} option, corresponding file names are printed when there is
at least one file argument.)
-By default, @sc{gnu} @command{sum} computes checksums using an algorithm
+By default, GNU @command{sum} computes checksums using an algorithm
compatible with BSD @command{sum} and prints file sizes in units of
1024-byte blocks.
@@ -3595,7 +3895,7 @@ by comparing the @command{cksum} output for the received files with the
@command{cksum} output for the original files (typically given in the
distribution).
-The CRC algorithm is specified by the @acronym{POSIX} standard. It is not
+The CRC algorithm is specified by the POSIX standard. It is not
compatible with the BSD or System V @command{sum} algorithms (see the
previous section); it is more robust.
@@ -3656,7 +3956,7 @@ The program accepts the following options. Also see @ref{Common options}.
@cindex binary input files
Treat each input file as binary, by reading it in binary mode and
outputting a @samp{*} flag. This is the inverse of @option{--text}.
-On systems like @acronym{GNU} that do not distinguish between binary
+On systems like GNU that do not distinguish between binary
and text files, this option merely flags each input mode as binary:
the MD5 checksum is unaffected. This option is the default on systems
like MS-DOS that distinguish between binary and text files, except
@@ -3686,7 +3986,7 @@ an MD5 checksum inconsistent with the associated file, or if no valid
line is found, @command{md5sum} exits with nonzero status. Otherwise,
it exits successfully.
-@itemx --quiet
+@item --quiet
@opindex --quiet
@cindex verifying MD5 checksums
This option is useful only when verifying checksums.
@@ -3695,7 +3995,7 @@ checked file. Files that fail the verification are reported in the
default one-line-per-file format. If there is any checksum mismatch,
print a warning summarizing the failures to standard error.
-@itemx --status
+@item --status
@opindex --status
@cindex verifying MD5 checksums
This option is useful only when verifying checksums.
@@ -3707,6 +4007,17 @@ If all listed files are readable and are consistent with the associated
MD5 checksums, exit successfully. Otherwise exit with a status code
indicating there was a failure.
+@item --tag
+@opindex --tag
+@cindex BSD output
+Output BSD style checksums, which indicate the checksum algorithm used.
+As a GNU extension, file names with problematic characters
+are escaped as described above, with the same escaping indicator of @samp{\}
+at the start of the line, being used.
+The @option{--tag} option implies binary mode, and is disallowed with
+@option{--text} mode as supporting that would unnecessarily complicate
+the output format, while providing little benefit.
+
@item -t
@itemx --text
@opindex -t
@@ -3714,10 +4025,10 @@ indicating there was a failure.
@cindex text input files
Treat each input file as text, by reading it in text mode and
outputting a @samp{ } flag. This is the inverse of @option{--binary}.
-This option is the default on systems like @acronym{GNU} that do not
+This option is the default on systems like GNU that do not
distinguish between binary and text files. On other systems, it is
the default for reading standard input when standard input is a
-terminal.
+terminal. This mode is never defaulted to if @option{--tag} is used.
@item -w
@itemx --warn
@@ -3728,7 +4039,7 @@ When verifying checksums, warn about improperly formatted MD5 checksum lines.
This option is useful only if all but a few lines in the checked input
are valid.
-@itemx --strict
+@item --strict
@opindex --strict
@cindex verifying MD5 checksums
When verifying checksums,
@@ -3891,19 +4202,19 @@ in their original relative order. The @option{--unique}
@vindex LC_COLLATE
Unless otherwise specified, all comparisons use the character collating
sequence specified by the @env{LC_COLLATE} locale.@footnote{If you
-use a non-@acronym{POSIX} locale (e.g., by setting @env{LC_ALL}
+use a non-POSIX locale (e.g., by setting @env{LC_ALL}
to @samp{en_US}), then @command{sort} may produce output that is sorted
differently than you're accustomed to. In that case, set the @env{LC_ALL}
-environment variable to @samp{C}. Note that setting only @env{LC_COLLATE}
+environment variable to @samp{C}@. Note that setting only @env{LC_COLLATE}
has two problems. First, it is ineffective if @env{LC_ALL} is also set.
Second, it has undefined behavior if @env{LC_CTYPE} (or @env{LANG}, if
@env{LC_CTYPE} is unset) is set to an incompatible value. For example,
you get undefined behavior if @env{LC_CTYPE} is @code{ja_JP.PCK} but
@env{LC_COLLATE} is @code{en_US.UTF-8}.}
-@sc{gnu} @command{sort} (as specified for all @sc{gnu} utilities) has no
+GNU @command{sort} (as specified for all GNU utilities) has no
limit on input line length or restrictions on bytes allowed within lines.
-In addition, if the final byte of an input file is not a newline, @sc{gnu}
+In addition, if the final byte of an input file is not a newline, GNU
@command{sort} silently supplies one. A line's trailing newline is not
part of the line for comparison purposes.
@@ -3926,7 +4237,7 @@ The following options affect the ordering of output lines. They may be
specified globally or as part of a specific key field. If no key
fields are specified, global options apply to comparison of entire
lines; otherwise the global options are inherited by key fields that do
-not specify any special options of their own. In pre-@acronym{POSIX}
+not specify any special options of their own. In pre-POSIX
versions of @command{sort}, global options affect only later key fields,
so portable shell scripts should specify global options first.
@@ -3954,7 +4265,7 @@ positions specified in keys with the @option{-k} option.
@vindex LC_CTYPE
Sort in @dfn{phone directory} order: ignore all characters except
letters, digits and blanks when sorting.
-By default letters and digits are those of @acronym{ASCII} and a blank
+By default letters and digits are those of ASCII and a blank
is a space or a tab, but the @env{LC_CTYPE} locale can change this.
@item -f
@@ -3968,8 +4279,8 @@ Fold lowercase characters into the equivalent uppercase characters when
comparing so that, for example, @samp{b} and @samp{B} sort as equal.
The @env{LC_CTYPE} locale determines character types.
When used with @option{--unique} those lower case equivalent lines are
-thrown away. (There is currently no way to throw away the upper case
-equivalent instead. (Any @option{--reverse} given would only affect
+thrown away. (There is currently no way to throw away the upper case
+equivalent instead. (Any @option{--reverse} given would only affect
the final result, after the throwing away.))
@item -g
@@ -4012,17 +4323,17 @@ converting to floating point.
@cindex human numeric sort
@vindex LC_NUMERIC
Sort numerically, first by numeric sign (negative, zero, or positive);
-then by @acronym{SI} suffix (either empty, or @samp{k} or @samp{K}, or
+then by SI suffix (either empty, or @samp{k} or @samp{K}, or
one of @samp{MGTPEZY}, in that order; @pxref{Block size}); and finally
by numeric value. For example, @samp{1023M} sorts before @samp{1G}
-because @samp{M} (mega) precedes @samp{G} (giga) as an @acronym{SI}
+because @samp{M} (mega) precedes @samp{G} (giga) as an SI
suffix. This option sorts values that are consistently scaled to the
nearest suffix, regardless of whether suffixes denote powers of 1000
or 1024, and it therefore sorts the output of any single invocation of
the @command{df}, @command{du}, or @command{ls} commands that are
invoked with their @option{--human-readable} or @option{--si} options.
The syntax for numbers is the same as for the @option{--numeric-sort}
-option; the @acronym{SI} suffix must immediately follow the number.
+option; the SI suffix must immediately follow the number.
@item -i
@itemx --ignore-nonprinting
@@ -4046,7 +4357,7 @@ This option has no effect if the stronger @option{--dictionary-order}
@vindex LC_TIME
An initial string, consisting of any amount of blanks, followed
by a month name abbreviation, is folded to UPPER case and
-compared in the order @samp{JAN} < @samp{FEB} < @dots{} < @samp{DEC}.
+compared in the order @samp{JAN} < @samp{FEB} < @dots{} < @samp{DEC}@.
Invalid names compare low to valid names. The @env{LC_TIME} locale
category determines the month spellings.
By default a blank is a space or a tab, but the @env{LC_CTYPE} locale
@@ -4173,7 +4484,7 @@ a temporary file, which is then used as an input in a subsequent merge.
A large value of @var{nmerge} may improve merge performance and decrease
temporary storage utilization at the expense of increased memory usage
-and I/O. Conversely a small value of @var{nmerge} may reduce memory
+and I/O@. Conversely a small value of @var{nmerge} may reduce memory
requirements and I/O at the expense of temporary storage consumption and
merge performance.
@@ -4197,7 +4508,7 @@ silently uses a smaller value.
Write output to @var{output-file} instead of standard output.
Normally, @command{sort} reads all input before opening
@var{output-file}, so you can safely sort a file in place by using
-commands like @code{sort -o F F} and @code{cat F | sort -o F}.
+commands like @code{sort -o F F} and @code{cat F | sort -o F}@.
However, @command{sort} with @option{--merge} (@option{-m}) can open
the output file before reading all input, so a command like @code{cat
F | sort -m -o F - G} is not safe as @command{sort} might start
@@ -4205,7 +4516,7 @@ writing @file{F} before @command{cat} is done reading it.
@vindex POSIXLY_CORRECT
On newer systems, @option{-o} cannot appear after an input file if
-@env{POSIXLY_CORRECT} is set, e.g., @samp{sort F -o F}. Portable
+@env{POSIXLY_CORRECT} is set, e.g., @samp{sort F -o F}@. Portable
scripts should specify @option{-o @var{output-file}} before any input
files.
@@ -4237,7 +4548,7 @@ Use a main-memory sort buffer of the given @var{size}. By default,
@var{size} to be interpreted as a percentage of physical memory.
Appending @samp{K} multiplies @var{size} by 1024 (the default),
@samp{M} by 1,048,576, @samp{G} by 1,073,741,824, and so on for
-@samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}. Appending
+@samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}@. Appending
@samp{b} causes @var{size} to be interpreted as a byte count, with no
multiplication.
@@ -4267,7 +4578,7 @@ However, fields that extend to the end of the line,
as @option{-k 2}, or fields consisting of a range, as @option{-k 2,3},
retain the field separators present between the endpoints of the range.
-To specify @acronym{ASCII} @sc{nul} as the field separator,
+To specify ASCII NUL as the field separator,
use the two-character string @samp{\0}, e.g., @samp{sort -t '\0'}.
@item -T @var{tempdir}
@@ -4316,9 +4627,9 @@ uniq} inspects the entire line. @xref{uniq invocation}.
@opindex -z
@opindex --zero-terminated
@cindex process zero-terminated items
-Delimit items with a zero byte rather than a newline (@acronym{ASCII} @sc{lf}).
-I.E. treat input as items separated by @acronym{ASCII} @sc{nul}
-and terminate output items with @acronym{ASCII} @sc{nul}.
+Delimit items with a zero byte rather than a newline (ASCII LF).
+I.e., treat input as items separated by ASCII NUL
+and terminate output items with ASCII NUL.
This option can be useful in conjunction with @samp{perl -0} or
@samp{find -print0} and @samp{xargs -0} which do the same in order to
reliably handle arbitrary file names (even those containing blanks
@@ -4331,9 +4642,9 @@ or other special characters).
Historical (BSD and System V) implementations of @command{sort} have
differed in their interpretation of some options, particularly
@option{-b}, @option{-f}, and @option{-n}.
-@sc{gnu} sort follows the @acronym{POSIX}
+GNU sort follows the POSIX
behavior, which is usually (but not always!) like the System V behavior.
-According to @acronym{POSIX}, @option{-n} no longer implies @option{-b}. For
+According to POSIX, @option{-n} no longer implies @option{-b}. For
consistency, @option{-M} has been changed in the same way. This may
affect the meaning of character positions in field specifications in
obscure cases. The only fix is to add an explicit @option{-b}.
@@ -4508,7 +4819,7 @@ by the sort operation.
@c @end example
@item
-Use the common @acronym{DSU, Decorate Sort Undecorate} idiom to
+Use the common DSU, Decorate Sort Undecorate idiom to
sort lines according to their length.
@example
@@ -4768,12 +5079,12 @@ This is equivalent to @option{--all-repeated} (@option{-D}).
@item prepend
Output a newline before each group of repeated lines.
With @option{--zero-terminated} (@option{-z}), use a zero
-byte (@acronym{ASCII} @sc{nul}) instead of a newline.
+byte (ASCII NUL) instead of a newline.
@item separate
Separate groups of repeated lines with a single newline.
With @option{--zero-terminated} (@option{-z}), use a zero
-byte (@acronym{ASCII} @sc{nul}) instead of a newline.
+byte (ASCII NUL) instead of a newline.
This is the same as using @samp{prepend}, except that
no delimiter is inserted before the first group, and hence
may be better suited for output direct to users.
@@ -4784,7 +5095,7 @@ two or more consecutive blank lines, then the output is ambiguous.
To avoid that, filter the input through @samp{tr -s '\n'} to replace
each sequence of consecutive newlines with a single newline.
-This is a @sc{gnu} extension.
+This is a GNU extension.
@c FIXME: give an example showing *how* it's useful
@item -u
@@ -4906,15 +5217,15 @@ ptx -G [@var{option} @dots{}] [@var{input} [@var{output}]]
@end example
The @option{-G} (or its equivalent: @option{--traditional}) option disables
-all @sc{gnu} extensions and reverts to traditional mode, thus introducing some
+all GNU extensions and reverts to traditional mode, thus introducing some
limitations and changing several of the program's default option values.
-When @option{-G} is not specified, @sc{gnu} extensions are always enabled.
-@sc{gnu} extensions to @command{ptx} are documented wherever appropriate in this
+When @option{-G} is not specified, GNU extensions are always enabled.
+GNU extensions to @command{ptx} are documented wherever appropriate in this
document. @xref{Compatibility in ptx}, for the full list.
Individual options are explained in the following sections.
-When @sc{gnu} extensions are enabled, there may be zero, one or several
+When GNU extensions are enabled, there may be zero, one or several
@var{file}s after the options. If there is no @var{file}, the program
reads the standard input. If there is one or several @var{file}s, they
give the name of input files which are all read in turn, as if all the
@@ -4924,7 +5235,7 @@ file names and line numbers refer to individual text input files. In
all cases, the program outputs the permuted index to the standard
output.
-When @sc{gnu} extensions are @emph{not} enabled, that is, when the program
+When GNU extensions are @emph{not} enabled, that is, when the program
operates in traditional mode, there may be zero, one or two parameters
besides the options. If there are no parameters, the program reads the
standard input and outputs the permuted index to the standard output.
@@ -4934,7 +5245,7 @@ respectively the name of the @var{input} file to read and the name of
the @var{output} file to produce. @emph{Be very careful} to note that,
in this case, the contents of file given by the second parameter is
destroyed. This behavior is dictated by System V @command{ptx}
-compatibility; @sc{gnu} Standards normally discourage output parameters not
+compatibility; GNU Standards normally discourage output parameters not
introduced by an option.
Note that for @emph{any} file named as the value of an option or as an
@@ -4958,7 +5269,7 @@ convention more than once per program invocation.
@item -G
@itemx --traditional
-As already explained, this option disables all @sc{gnu} extensions to
+As already explained, this option disables all GNU extensions to
@command{ptx} and switches to traditional mode.
@item --help
@@ -4979,10 +5290,10 @@ processing.
@c FIXME: People don't necessarily know what an IBM-PC was these days.
As it is set up now, the program assumes that the input file is coded
-using 8-bit @acronym{ISO} 8859-1 code, also known as Latin-1 character set,
+using 8-bit ISO 8859-1 code, also known as Latin-1 character set,
@emph{unless} it is compiled for MS-DOS, in which case it uses the
-character set of the IBM-PC@. (@sc{gnu} @command{ptx} is not known to work on
-smaller MS-DOS machines anymore.) Compared to 7-bit @acronym{ASCII}, the set
+character set of the IBM-PC@. (GNU @command{ptx} is not known to work on
+smaller MS-DOS machines anymore.) Compared to 7-bit ASCII, the set
of characters which are letters is different; this alters the behavior
of regular expression matching. Thus, the default regular expression
for a keyword allows foreign or diacriticized letters. Keyword sorting,
@@ -5014,9 +5325,9 @@ is not part of the Break file is a word constituent. If both options
@option{-b} and @option{-W} are specified, then @option{-W} has precedence and
@option{-b} is ignored.
-When @sc{gnu} extensions are enabled, the only way to avoid newline as a
+When GNU extensions are enabled, the only way to avoid newline as a
break character is to write all the break characters in the file with no
-newline at all, not even at the end of the file. When @sc{gnu} extensions
+newline at all, not even at the end of the file. When GNU extensions
are disabled, spaces, tabs and newlines are always considered as break
characters even if not included in the Break file.
@@ -5055,7 +5366,7 @@ Using this option changes the default value for option @option{-S}.
Using this option, the program does not try very hard to remove
references from contexts in output, but it succeeds in doing so
@emph{when} the context ends exactly at the newline. If option
-@option{-r} is used with @option{-S} default value, or when @sc{gnu} extensions
+@option{-r} is used with @option{-S} default value, or when GNU extensions
are disabled, this condition is always met and references are completely
excluded from the output contexts.
@@ -5066,15 +5377,15 @@ This option selects which regular expression will describe the end of a
line or the end of a sentence. In fact, this regular expression is not
the only distinction between end of lines or end of sentences, and input
line boundaries have no special significance outside this option. By
-default, when @sc{gnu} extensions are enabled and if @option{-r} option is not
+default, when GNU extensions are enabled and if @option{-r} option is not
used, end of sentences are used. In this case, this @var{regex} is
-imported from @sc{gnu} Emacs:
+imported from GNU Emacs:
@example
[.?!][]\"')@}]*\\($\\|\t\\| \\)[ \t\n]*
@end example
-Whenever @sc{gnu} extensions are disabled or if @option{-r} option is used, end
+Whenever GNU extensions are disabled or if @option{-r} option is used, end
of lines are used; in this case, the default @var{regexp} is just:
@example
@@ -5106,8 +5417,8 @@ corresponding characters by @command{ptx} itself.
@itemx --word-regexp=@var{regexp}
This option selects which regular expression will describe each keyword.
-By default, if @sc{gnu} extensions are enabled, a word is a sequence of
-letters; the @var{regexp} used is @samp{\w+}. When @sc{gnu} extensions are
+By default, if GNU extensions are enabled, a word is a sequence of
+letters; the @var{regexp} used is @samp{\w+}. When GNU extensions are
disabled, a word is by default anything which ends with a space, a tab
or a newline; the @var{regexp} used is @samp{[^ \t\n]+}.
@@ -5127,14 +5438,14 @@ the corresponding characters by @command{ptx} itself.
Output format is mainly controlled by the @option{-O} and @option{-T} options
described in the table below. When neither @option{-O} nor @option{-T} are
-selected, and if @sc{gnu} extensions are enabled, the program chooses an
+selected, and if GNU extensions are enabled, the program chooses an
output format suitable for a dumb terminal. Each keyword occurrence is
output to the center of one line, surrounded by its left and right
contexts. Each field is properly justified, so the concordance output
can be readily observed. As a special feature, if automatic
references are selected by option @option{-A} and are output before the
left context, that is, if option @option{-R} is @emph{not} selected, then
-a colon is added after the reference; this nicely interfaces with @sc{gnu}
+a colon is added after the reference; this nicely interfaces with GNU
Emacs @code{next-error} processing. In this default output format, each
white space character, like newline and tab, is merely changed to
exactly one space, with no special attempt to compress consecutive
@@ -5157,7 +5468,7 @@ output line.
Select the maximum output width of each final line. If references are
used, they are included or excluded from the maximum output width
-depending on the value of option @option{-R}. If this option is not
+depending on the value of option @option{-R}@. If this option is not
selected, that is, when references are output before the left context,
the maximum output width takes into account the maximum length of all
references. If this option is selected, that is, when references are
@@ -5187,7 +5498,7 @@ context. For any other output format, option @option{-R} is
ignored, with one exception: with @option{-R} the width of references
is @emph{not} taken into account in total output width given by @option{-w}.
-This option is automatically selected whenever @sc{gnu} extensions are
+This option is automatically selected whenever GNU extensions are
disabled.
@item -F @var{string}
@@ -5196,14 +5507,14 @@ disabled.
This option will request that any truncation in the output be reported
using the string @var{string}. Most output fields theoretically extend
towards the beginning or the end of the current line, or current
-sentence, as selected with option @option{-S}. But there is a maximum
+sentence, as selected with option @option{-S}@. But there is a maximum
allowed output line width, changeable through option @option{-w}, which is
further divided into space for various output fields. When a field has
to be truncated because it cannot extend beyond the beginning or the end of
the current line to fit in, then a truncation occurs. By default,
the string used is a single slash, as in @option{-F /}.
-@var{string} may have more than one character, as in @option{-F ...}.
+@var{string} may have more than one character, as in @option{-F @dots{}}.
Also, in the particular case when @var{string} is empty (@option{-F ""}),
truncation flagging is disabled, and no truncation marks are appended in
this case.
@@ -5230,7 +5541,7 @@ processing. Each output line will look like:
@end smallexample
so it will be possible to write a @samp{.xx} roff macro to take care of
-the output typesetting. This is the default output format when @sc{gnu}
+the output typesetting. This is the default output format when GNU
extensions are disabled. Option @option{-M} can be used to change
@samp{xx} to another macro name.
@@ -5267,7 +5578,7 @@ Circumflex and tilde diacritical marks produce the sequence @code{^\@{ @}} and
@code{~\@{ @}} respectively. Other diacriticized characters of the
underlying character set produce an appropriate @TeX{} sequence as far
as possible. The other non-graphical characters, like newline and tab,
-and all other characters which are not part of @acronym{ASCII}, are merely
+and all other characters which are not part of ASCII, are merely
changed to exactly one space, with no special attempt to compress
consecutive spaces. Let me know how to improve this special character
processing for @TeX{}.
@@ -5276,13 +5587,13 @@ processing for @TeX{}.
@node Compatibility in ptx
-@subsection The @sc{gnu} extensions to @command{ptx}
+@subsection The GNU extensions to @command{ptx}
This version of @command{ptx} contains a few features which do not exist in
System V @command{ptx}. These extra features are suppressed by using the
@option{-G} command line option, unless overridden by other command line
-options. Some @sc{gnu} extensions cannot be recovered by overriding, so the
-simple rule is to avoid @option{-G} if you care about @sc{gnu} extensions.
+options. Some GNU extensions cannot be recovered by overriding, so the
+simple rule is to avoid @option{-G} if you care about GNU extensions.
Here are the differences between this program and System V @command{ptx}.
@itemize @bullet
@@ -5295,8 +5606,8 @@ or, if a second @var{file} parameter is given on the command, to that
@var{file}.
Having output parameters not introduced by options is a dangerous
-practice which @sc{gnu} avoids as far as possible. So, for using @command{ptx}
-portably between @sc{gnu} and System V, you should always use it with a
+practice which GNU avoids as far as possible. So, for using @command{ptx}
+portably between GNU and System V, you should always use it with a
single input file, and always expect the result on standard output. You
might also want to automatically configure in a @option{-G} option to
@command{ptx} calls in products using @command{ptx}, if the configurator finds
@@ -5305,9 +5616,9 @@ that the installed @command{ptx} accepts @option{-G}.
@item
The only options available in System V @command{ptx} are options @option{-b},
@option{-f}, @option{-g}, @option{-i}, @option{-o}, @option{-r}, @option{-t} and
-@option{-w}. All other options are @sc{gnu} extensions and are not repeated in
+@option{-w}. All other options are GNU extensions and are not repeated in
this enumeration. Moreover, some options have a slightly different
-meaning when @sc{gnu} extensions are enabled, as explained below.
+meaning when GNU extensions are enabled, as explained below.
@item
By default, concordance output is not formatted for @command{troff} or
@@ -5316,29 +5627,30 @@ or @command{nroff} output may still be selected through option @option{-O}.
@item
Unless @option{-R} option is used, the maximum reference width is
-subtracted from the total output line width. With @sc{gnu} extensions
+subtracted from the total output line width. With GNU extensions
disabled, width of references is not taken into account in the output
line width computations.
@item
-All 256 bytes, even @acronym{ASCII} @sc{nul} bytes, are always read and
-processed from input file with no adverse effect, even if @sc{gnu} extensions
-are disabled. However, System V @command{ptx} does not accept 8-bit characters,
-a few control characters are rejected, and the tilde @kbd{~} is also rejected.
+All 256 bytes, even ASCII NUL bytes, are always read and
+processed from input file with no adverse effect, even if GNU extensions
+are disabled. However, System V @command{ptx} does not accept 8-bit
+characters, a few control characters are rejected, and the tilde
+@kbd{~} is also rejected.
@item
-Input line length is only limited by available memory, even if @sc{gnu}
+Input line length is only limited by available memory, even if GNU
extensions are disabled. However, System V @command{ptx} processes only
the first 200 characters in each line.
@item
The break (non-word) characters default to be every character except all
-letters of the underlying character set, diacriticized or not. When @sc{gnu}
+letters of the underlying character set, diacriticized or not. When GNU
extensions are disabled, the break characters default to space, tab and
newline only.
@item
-The program makes better use of output line width. If @sc{gnu} extensions
+The program makes better use of output line width. If GNU extensions
are disabled, the program rather tries to imitate System V @command{ptx},
but still, there are some slight disposition glitches this program does
not completely reproduce.
@@ -5626,7 +5938,7 @@ ranges of selected bytes.
@item --complement
@opindex --complement
-This option is a @acronym{GNU} extension.
+This option is a GNU extension.
Select for printing the complement of the bytes, characters or fields
selected with the @option{-b}, @option{-c} or @option{-f} options.
In other words, do @emph{not} print the bytes, characters or fields
@@ -5742,7 +6054,7 @@ do so consistently between @command{join} and @command{sort}.
If @samp{join -t ''} is specified then the whole line is considered which
matches the default operation of sort.
-If the input has no unpairable lines, a @acronym{GNU} extension is
+If the input has no unpairable lines, a GNU extension is
available; the sort order can be any order that considers two fields
to be equal if and only if the sort comparison described above
considers them to be equal. For example:
@@ -5794,12 +6106,12 @@ Do not check that both input files are in sorted order. This is the default.
@item -e @var{string}
@opindex -e
Replace those output fields that are missing in the input with @var{string}.
-I.E. missing fields specified with the @option{-12jo} options.
+I.e., missing fields specified with the @option{-12jo} options.
@item --header
@opindex --header
-Treat the first line of each input file as a header line. The header lines will
-be joined and printed as the first output line. If @option{-o} is used to
+Treat the first line of each input file as a header line. The header lines
+will be joined and printed as the first output line. If @option{-o} is used to
specify output format, the header line will be printed according to the
specified format. The header lines will not be checked for ordering even if
@option{--check-order} is specified. Also if the header lines from each file
@@ -5844,7 +6156,7 @@ to the join field. However, when printing unpairable lines
(using either of the @option{-a} or @option{-v} options), there is no way
to specify the join field using @var{m.n} in @var{field-list}
if there are unpairable lines in both files.
-To give @command{join} that functionality, @acronym{POSIX} invented the @samp{0}
+To give @command{join} that functionality, POSIX invented the @samp{0}
field specification notation.
The elements in @var{field-list}
@@ -5862,7 +6174,7 @@ Treat as significant each occurrence of @var{char} in the input file.
Use @samp{sort -t @var{char}}, without the @option{-b} option of
@samp{sort}, to produce this ordering. If @samp{join -t ''} is specified,
the whole line is considered, matching the default operation of sort.
-If @samp{-t '\0'} is specified then the @acronym{ASCII} @sc{nul}
+If @samp{-t '\0'} is specified then the ASCII NUL
character is used to delimit the fields.
@item -v @var{file-number}
@@ -5995,7 +6307,7 @@ from @var{m} through @var{n}, in ascending order. @var{m} should
collate before @var{n}; if it doesn't, an error results. As an example,
@samp{0-9} is the same as @samp{0123456789}.
-@sc{gnu} @command{tr} does not support the System V syntax that uses square
+GNU @command{tr} does not support the System V syntax that uses square
brackets to enclose ranges. Translations specified in that format
sometimes work as expected, since the brackets are often transliterated
to themselves. However, they should be avoided because they sometimes
@@ -6003,10 +6315,10 @@ behave unexpectedly. For example, @samp{tr -d '[0-9]'} deletes brackets
as well as digits.
Many historically common and even accepted uses of ranges are not
-portable. For example, on @acronym{EBCDIC} hosts using the @samp{A-Z}
+portable. For example, on EBCDIC hosts using the @samp{A-Z}
range will not do what most would expect because @samp{A} through @samp{Z}
-are not contiguous as they are in @acronym{ASCII}.
-If you can rely on a @acronym{POSIX} compliant version of @command{tr}, then
+are not contiguous as they are in ASCII@.
+If you can rely on a POSIX compliant version of @command{tr}, then
the best way to work around this is to use character classes (see below).
Otherwise, it is most portable (and most ugly) to enumerate the members
of the ranges.
@@ -6083,7 +6395,7 @@ The syntax @samp{[=@var{c}=]} expands to all of the characters that are
equivalent to @var{c}, in no particular order. Equivalence classes are
a relatively recent invention intended to support non-English alphabets.
But there seems to be no standard way to define them or determine their
-contents. Therefore, they are not fully implemented in @sc{gnu} @command{tr};
+contents. Therefore, they are not fully implemented in GNU @command{tr};
each character's equivalence class consists only of that character,
which is of no particular use.
@@ -6126,14 +6438,14 @@ typically have the same length. If @var{set1} is shorter than
@var{set2}, the extra characters at the end of @var{set2} are ignored.
On the other hand, making @var{set1} longer than @var{set2} is not
-portable; @acronym{POSIX} says that the result is undefined. In this situation,
+portable; POSIX says that the result is undefined. In this situation,
BSD @command{tr} pads @var{set2} to the length of @var{set1} by repeating
the last character of @var{set2} as many times as necessary. System V
@command{tr} truncates @var{set1} to the length of @var{set2}.
-By default, @sc{gnu} @command{tr} handles this case like BSD @command{tr}.
+By default, GNU @command{tr} handles this case like BSD @command{tr}.
When the @option{--truncate-set1} (@option{-t}) option is given,
-@sc{gnu} @command{tr} handles this case like the System V @command{tr}
+GNU @command{tr} handles this case like the System V @command{tr}
instead. This option is ignored for operations other than translation.
Acting like System V @command{tr} in this case breaks the relatively common
@@ -6151,7 +6463,7 @@ newlines.
@noindent
By the way, the above idiom is not portable because it uses ranges, and
it assumes that the octal code for newline is 012.
-Assuming a @acronym{POSIX} compliant @command{tr}, here is a better
+Assuming a POSIX compliant @command{tr}, here is a better
way to write it:
@example
@@ -6329,7 +6641,7 @@ characters) on each line to spaces.
@command{unexpand} writes the contents of each given @var{file}, or
standard input if none are given or for a @var{file} of @samp{-}, to
standard output, converting blanks at the beginning of each line into
-as many tab characters as needed. In the default @acronym{POSIX}
+as many tab characters as needed. In the default POSIX
locale, a @dfn{blank} is a space or a tab; other locales may specify
additional blank characters. Synopsis:
@@ -6408,7 +6720,7 @@ directory, acting as if it had been invoked with a single argument of @samp{.}.
@vindex LC_ALL
By default, the output is sorted alphabetically, according to the locale
-settings in effect.@footnote{If you use a non-@acronym{POSIX}
+settings in effect.@footnote{If you use a non-POSIX
locale (e.g., by setting @env{LC_ALL} to @samp{en_US}), then @command{ls} may
produce output that is sorted differently than you're accustomed to.
In that case, set the @env{LC_ALL} environment variable to @samp{C}.}
@@ -6501,7 +6813,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}),
If a command line argument specifies a symbolic link, show information
for the file the link references rather than for the link itself.
-@itemx --dereference-command-line-symlink-to-dir
+@item --dereference-command-line-symlink-to-dir
@opindex --dereference-command-line-symlink-to-dir
@cindex symbolic links, dereferencing
Do not dereference symbolic links, with one exception:
@@ -6689,7 +7001,7 @@ $ ls -blog --dired 'a b'
If you use a quoting style that adds quote marks
(e.g., @option{--quoting-style=c}), 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}
+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
prepared to parse the escaped names.
@@ -6709,7 +7021,7 @@ Produce long format directory listings, but don't display owner information.
@opindex -G
@opindex --no-group
Inhibit display of group information in a long format directory listing.
-(This is the default in some non-@sc{gnu} versions of @command{ls}, so we
+(This is the default in some non-GNU versions of @command{ls}, so we
provide this option for compatibility.)
@optHumanReadable
@@ -6891,7 +7203,7 @@ to the left of the size column.
@cindex sorting @command{ls} output
These options change the order in which @command{ls} sorts the information
it outputs. By default, sorting is done by character code
-(e.g., @acronym{ASCII} order).
+(e.g., ASCII order).
@table @samp
@@ -7023,7 +7335,7 @@ which has some caveats worth noting.
@itemize @bullet
@item @env{LC_COLLATE} is ignored, which means @samp{ls -v} and @samp{sort -V}
will sort non-numeric prefixes as if the @env{LC_COLLATE} locale category
-was set to @samp{C}.
+was set to @samp{C}@.
@item Some suffixes will not be matched by the regular
expression mentioned above. Consequently these examples may
not sort as you expect:
@@ -7062,7 +7374,7 @@ output is not a terminal.
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.
-@sc{gnu} @command{ls} uses variable width columns to display as many files as
+GNU @command{ls} uses variable width columns to display as many files as
possible in the fewest lines.
@item --color [=@var{when}]
@@ -7203,7 +7515,7 @@ Assume that each tab stop is @var{cols} columns wide. The default is 8.
@c FIXME: remove in 2009, if Apple Terminal has been fixed for long enough.
Some terminal emulators (at least Apple Terminal 1.5 (133) from Mac OS X 10.4.8)
do not properly align columns to the right of a TAB following a
-non-@acronym{ASCII} byte. If you use such a terminal emulator, use the
+non-ASCII byte. If you use such a terminal emulator, use the
@option{-T0} option or put @code{TABSIZE=0} in your environment to tell
@command{ls} to align using spaces, not tabs.
@@ -7266,25 +7578,25 @@ files; if you want output columns to line up, you may need to insert
spaces in one of the two formats.
@item full-iso
-List timestamps in full using @acronym{ISO} 8601 date, time, and time zone
+List timestamps in full using ISO 8601 date, time, and time zone
format with nanosecond precision, e.g., @samp{2002-03-30
23:45:56.477817180 -0700}. This style is equivalent to
@samp{+%Y-%m-%d %H:%M:%S.%N %z}.
This is useful because the time output includes all the information that
is available from the operating system. For example, this can help
-explain @command{make}'s behavior, since @acronym{GNU} @command{make}
+explain @command{make}'s behavior, since GNU @command{make}
uses the full timestamp to determine whether a file is out of date.
@item long-iso
-List @acronym{ISO} 8601 date and time in minutes, e.g.,
+List ISO 8601 date and time in minutes, e.g.,
@samp{2002-03-30 23:45}. These timestamps are shorter than
@samp{full-iso} timestamps, and are usually good enough for everyday
work. This style is equivalent to @samp{+%Y-%m-%d %H:%M}.
@item iso
-List @acronym{ISO} 8601 dates for non-recent timestamps (e.g.,
-@samp{2002-03-30@ }), and @acronym{ISO} 8601 month, day, hour, and
+List ISO 8601 dates for non-recent timestamps (e.g.,
+@samp{2002-03-30@ }), and ISO 8601 month, day, hour, and
minute for recent timestamps (e.g., @samp{03-30 23:45}). These
timestamps are uglier than @samp{long-iso} timestamps, but they carry
nearly the same information in a smaller space and their brevity helps
@@ -7308,7 +7620,7 @@ are harder for programs to parse because locale conventions vary so
widely, but they are easier for many people to read.
The @env{LC_TIME} locale category specifies the timestamp format. The
-default @acronym{POSIX} locale uses timestamps like @samp{Mar 30@
+default POSIX locale uses timestamps like @samp{Mar 30@
@ 2002} and @samp{Mar 30 23:45}; in this locale, the following two
@command{ls} invocations are equivalent:
@@ -7327,21 +7639,21 @@ and might generate timestamps like @samp{30. M@"ar 2002@ } and
@item posix-@var{style}
@vindex LC_TIME
-List @acronym{POSIX}-locale timestamps if the @env{LC_TIME} locale
-category is @acronym{POSIX}, @var{style} timestamps otherwise. For
+List POSIX-locale timestamps if the @env{LC_TIME} locale
+category is POSIX, @var{style} timestamps otherwise. For
example, the @samp{posix-long-iso} style lists
timestamps like @samp{Mar 30@ @ 2002} and @samp{Mar 30 23:45} when in
-the @acronym{POSIX} locale, and like @samp{2002-03-30 23:45} otherwise.
+the POSIX locale, and like @samp{2002-03-30 23:45} otherwise.
@end table
@end table
@vindex TIME_STYLE
You can specify the default value of the @option{--time-style} option
with the environment variable @env{TIME_STYLE}; if @env{TIME_STYLE} is not set
-the default style is @samp{locale}. @acronym{GNU} Emacs 21.3 and
+the default style is @samp{locale}. GNU Emacs 21.3 and
later use the @option{--dired} option and therefore can parse any date
format, but if you are using Emacs 21.1 or 21.2 and specify a
-non-@acronym{POSIX} locale you may need to set
+non-POSIX locale you may need to set
@samp{TIME_STYLE="posix-long-iso"}.
To avoid certain denial-of-service attacks, timestamps that would be
@@ -7407,7 +7719,7 @@ Output strings as-is; this is the same as the @option{-N} or
@item shell
Quote strings for the shell if they contain shell metacharacters or would
cause ambiguous output.
-The quoting is suitable for @acronym{POSIX}-compatible shells like
+The quoting is suitable for POSIX-compatible shells like
@command{bash}, but it does not always work for incompatible shells
like @command{csh}.
@item shell-always
@@ -7433,7 +7745,7 @@ this"} in the default C locale. This looks nicer on many displays.
@end table
You can specify the default value of the @option{--quoting-style} option
-with the environment variable @env{QUOTING_STYLE}. If that environment
+with the environment variable @env{QUOTING_STYLE}@. If that environment
variable is not set, the default value is @samp{literal}, but this
default may change to @samp{shell} in a future version of this package.
@@ -7618,7 +7930,7 @@ link only when it refers to an existing regular file.
However, when copying to a dangling symbolic link, @command{cp}
refuses by default, and fails with a diagnostic, since the operation
is inherently dangerous. This behavior is contrary to historical
-practice and to @acronym{POSIX}.
+practice and to POSIX@.
Set @env{POSIXLY_CORRECT} to make @command{cp} attempt to create
the target of a dangling destination symlink, in spite of the possible risk.
Also, when an option like
@@ -7654,7 +7966,7 @@ Try to preserve SELinux security context and extended attributes (xattr),
but ignore any failure to do that and print no corresponding diagnostic.
Equivalent to @option{-dR --preserve=all} with the reduced diagnostics.
-@itemx --attributes-only
+@item --attributes-only
@opindex --attributes-only
Copy only the specified attributes of the source file to the destination.
If the destination already exists, do not alter its contents.
@@ -7676,10 +7988,12 @@ combination of options is this tiny Bourne shell script:
@example
#!/bin/sh
# Usage: backup FILE...
-# Create a @sc{gnu}-style backup of each listed FILE.
+# Create a GNU-style backup of each listed FILE.
+fail=0
for i; do
- cp --backup --force -- "$i" "$i"
+ cp --backup --force --preserve=all -- "$i" "$i" || fail=1
done
+exit $fail
@end example
@item --copy-contents
@@ -7712,7 +8026,7 @@ Equivalent to @option{--no-dereference --preserve=links}.
@opindex -f
@opindex --force
When copying without this option and an existing destination file cannot
-be opened for writing, the copy fails. However, with @option{--force}),
+be opened for writing, the copy fails. However, with @option{--force},
when a destination file cannot be opened, @command{cp} then removes it and
tries to open it again. Contrast this behavior with that enabled by
@option{--link} and @option{--symbolic-link}, whereby the destination file
@@ -7722,8 +8036,8 @@ description of @option{--remove-destination}.
This option is independent of the @option{--interactive} or
@option{-i} option: neither cancels the effect of the other.
-This option is redundant if the @option{--no-clobber} or @option{-n} option is
-used.
+This option is ignored when the @option{--no-clobber} or @option{-n} option
+is also used.
@item -H
@opindex -H
@@ -7737,7 +8051,7 @@ via recursive traversal.
@opindex -i
@opindex --interactive
When copying a file other than a directory, prompt whether to
-overwrite an existing destination file. The @option{-i} option overrides
+overwrite an existing destination file. The @option{-i} option overrides
a previous @option{-n} option.
@item -l
@@ -7759,8 +8073,8 @@ a regular file in the destination tree.
@itemx --no-clobber
@opindex -n
@opindex --no-clobber
-Do not overwrite an existing file. The @option{-n} option overrides a previous
-@option{-i} option. This option is mutually exclusive with @option{-b} or
+Do not overwrite an existing file. The @option{-n} option overrides a previous
+@option{-i} option. This option is mutually exclusive with @option{-b} or
@option{--backup} option.
@item -P
@@ -7782,21 +8096,21 @@ If specified, the @var{attribute_list} must be a comma-separated list
of one or more of the following strings:
@table @samp
-@itemx mode
+@item mode
Preserve the file mode bits and access control lists.
-@itemx ownership
+@item ownership
Preserve the owner and group. On most modern systems,
only users with appropriate privileges may change the owner of a file,
and ordinary users
may preserve the group ownership of a file only if they happen to be
a member of the desired group.
-@itemx timestamps
+@item timestamps
Preserve the times of last access and last modification, when possible.
On older systems, it is not possible to preserve these attributes
when the affected file is a symbolic link.
However, many systems now provide the @code{utimensat} function,
which makes it possible even for symbolic links.
-@itemx links
+@item links
Preserve in the destination files
any links between corresponding source files.
Note that with @option{-L} or @option{-H}, this option can convert
@@ -7820,14 +8134,15 @@ $ mkdir b c; (cd b; : > a; ln -s a b); cp -aL b c; ls -i1 c/b
74163295 b
@end smallexample
-@itemx context
+@item context
Preserve SELinux security context of the file, or fail with full diagnostics.
-@itemx xattr
+@item xattr
Preserve extended attributes of the file, or fail with full diagnostics.
If @command{cp} is built without xattr support, ignore this option.
If SELinux context, ACLs or Capabilities are implemented using xattrs,
-they are preserved by this option as well.
-@itemx all
+they are preserved implicitly by this option as well, i.e., even without
+specifying @option{--preserve=mode} or @option{--preserve=context}.
+@item all
Preserve all file attributes.
Equivalent to specifying all of the above, but with the difference
that failure to preserve SELinux security context or extended attributes
@@ -7843,12 +8158,12 @@ mode bits of the corresponding source file, minus the bits set in the
umask and minus the set-user-ID and set-group-ID bits.
@xref{File permissions}.
-@itemx @w{@kbd{--no-preserve}=@var{attribute_list}}
+@item @w{@kbd{--no-preserve}=@var{attribute_list}}
@cindex file information, preserving
Do not preserve the specified attributes. The @var{attribute_list}
has the same form as for @option{--preserve}.
-@itemx --parents
+@item --parents
@opindex --parents
@cindex parent directories and @command{cp}
Form the name of each destination file by appending to the target
@@ -7881,10 +8196,10 @@ links in the source; see the @option{--archive} (@option{-a}), @option{-d},
creating a destination file of the same type as the source; see the
@option{--copy-contents} option. It is not portable to use
@option{-r} to copy symbolic links or special files. On some
-non-@sc{gnu} systems, @option{-r} implies the equivalent of
+non-GNU systems, @option{-r} implies the equivalent of
@option{-L} and @option{--copy-contents} for historical reasons.
Also, it is not portable to use @option{-R} to copy symbolic links
-unless you also specify @option{-P}, as @acronym{POSIX} allows
+unless you also specify @option{-P}, as POSIX allows
implementations that dereference symbolic links by default.
@item --reflink[=@var{when}]
@@ -7893,7 +8208,7 @@ implementations that dereference symbolic links by default.
@cindex clone
@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
+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,
the other suffers the same fate.
@@ -8033,7 +8348,9 @@ dd @var{option}
@end example
The only options are @option{--help} and @option{--version}.
-@xref{Common options}. @command{dd} accepts the following operands.
+@xref{Common options}. @command{dd} accepts the following operands,
+whose syntax was inspired by the DD (data definition) statement of
+OS/360 JCL.
@table @samp
@@ -8102,11 +8419,31 @@ Copy @var{n} @samp{ibs}-byte blocks from the input file, instead
of everything until the end of the file.
if @samp{iflag=count_bytes} is specified, @var{n} is interpreted
as a byte count rather than a block count.
+Note if the input may return short reads as could be the case
+when reading from a pipe for example, @samp{iflag=fullblock}
+will ensure that @samp{count=} corresponds to complete input blocks
+rather than the traditional POSIX specified behavior of counting
+input read operations.
-@item status=noxfer
+@item status=@var{which}
@opindex status
-Do not print the overall transfer rate and volume statistics
-that normally make up the third status line when @command{dd} exits.
+Transfer information is normally output to stderr upon
+receipt of the @samp{INFO} signal or when @command{dd} exits.
+Specifying @var{which} will identify which information to suppress.
+
+@table @samp
+
+@item noxfer
+@opindex noxfer @r{dd status=}
+Do not print the transfer rate and volume statistics
+that normally make up the last status line.
+
+@item none
+@opindex none @r{dd status=}
+Do not print any informational messages to stderr.
+Error messages are output as normal.
+
+@end table
@item conv=@var{conversion}[,@var{conversion}]@dots{}
@opindex conv
@@ -8119,19 +8456,19 @@ Conversions:
@item ascii
@opindex ascii@r{, converting to}
-Convert @acronym{EBCDIC} to @acronym{ASCII},
-using the conversion table specified by @acronym{POSIX}.
+Convert EBCDIC to ASCII,
+using the conversion table specified by POSIX@.
This provides a 1:1 translation for all 256 bytes.
@item ebcdic
@opindex ebcdic@r{, converting to}
-Convert @acronym{ASCII} to @acronym{EBCDIC}.
+Convert ASCII to EBCDIC@.
This is the inverse of the @samp{ascii} conversion.
@item ibm
@opindex alternate ebcdic@r{, converting to}
-Convert @acronym{ASCII} to alternate @acronym{EBCDIC},
-using the alternate conversion table specified by @acronym{POSIX}.
+Convert ASCII to alternate EBCDIC,
+using the alternate conversion table specified by POSIX@.
This is not a 1:1 translation, but reflects common historical practice
for @samp{~}, @samp{[}, and @samp{]}.
@@ -8162,27 +8499,27 @@ The @samp{lcase} and @samp{ucase} conversions are mutually exclusive.
@item sparse
@opindex sparse
-Try to seek rather than write @sc{nul} output blocks.
+Try to seek rather than write NUL output blocks.
On a file system that supports sparse files, this will create
sparse output when extending the output file.
Be careful when using this option in conjunction with
@samp{conv=notrunc} or @samp{oflag=append}.
With @samp{conv=notrunc}, existing data in the output file
-corresponding to @sc{nul} blocks from the input, will be untouched.
+corresponding to NUL blocks from the input, will be untouched.
With @samp{oflag=append} the seeks performed will be ineffective.
Similarly, when the output is a device rather than a file,
-@sc{nul} input blocks are not copied, and therefore this option
+NUL input blocks are not copied, and therefore this option
is most useful with virtual or pre zeroed devices.
@item swab
@opindex swab @r{(byte-swapping)}
@cindex byte-swapping
-Swap every pair of input bytes. @sc{gnu} @command{dd}, unlike others, works
+Swap every pair of input bytes. GNU @command{dd}, unlike others, works
when an odd number of bytes are read---the last byte is simply copied
(since there is nothing to swap it with).
@item sync
-@opindex sync @r{(padding with @acronym{ASCII} @sc{nul}s)}
+@opindex sync @r{(padding with ASCII NULs)}
Pad every input block to size of @samp{ibs} with trailing zero bytes.
When used with @samp{block} or @samp{unblock}, pad with spaces instead of
zero bytes.
@@ -8259,7 +8596,7 @@ output file to be truncated before being appended to.
@opindex cio
@cindex concurrent I/O
Use concurrent I/O mode for data. This mode performs direct I/O
-and drops the @acronym{POSIX} requirement to serialize all I/O to the same file.
+and drops the POSIX requirement to serialize all I/O to the same file.
A file cannot be opened in CIO mode and with a standard open at the
same time.
@@ -8335,7 +8672,7 @@ idea to test it on your files before relying on it.
@cindex controlling terminal
Do not assign the file to be a controlling terminal for @command{dd}.
This has no effect when the file is not a terminal.
-On many hosts (e.g., @acronym{GNU}/Linux hosts), this option has no effect
+On many hosts (e.g., GNU/Linux hosts), this option has no effect
at all.
@item nofollow
@@ -8351,13 +8688,13 @@ Fail if the file has multiple hard links.
@item binary
@opindex binary
@cindex binary I/O
-Use binary I/O. This option has an effect only on nonstandard
+Use binary I/O@. This option has an effect only on nonstandard
platforms that distinguish binary from text I/O.
@item text
@opindex text
@cindex text I/O
-Use text I/O. Like @samp{binary}, this option has no effect on
+Use text I/O@. Like @samp{binary}, this option has no effect on
standard platforms.
@item fullblock
@@ -8367,6 +8704,10 @@ may return early if a full block is not available.
When that happens, continue calling @code{read} to fill the remainder
of the block.
This flag can be used only with @code{iflag}.
+This flag is useful with pipes for example
+as they may return short reads. In that case,
+this flag is needed to ensure that a @samp{count=} argument is
+interpreted as a block count rather than a count of read operations.
@item count_bytes
@opindex count_bytes
@@ -8401,8 +8742,8 @@ affected file descriptors, even after @command{dd} exits.
@end table
@cindex multipliers after numbers
-The numeric-valued strings above (@var{bytes} and @var{blocks}) can be
-followed by a multiplier: @samp{b}=512, @samp{c}=1,
+The numeric-valued strings above (@var{n} and @var{bytes})
+can be followed by a multiplier: @samp{b}=512, @samp{c}=1,
@samp{w}=2, @samp{x@var{m}}=@var{m}, or any of the
standard block size suffixes like @samp{k}=1024 (@pxref{Block size}).
@@ -8606,7 +8947,7 @@ to when they were last installed.
@cindex stripping symbol table information
Strip the symbol tables from installed binary executables.
-@itemx --strip-program=@var{program}
+@item --strip-program=@var{program}
@opindex --strip-program
@cindex symbol table information, stripping, program
Program used to strip binaries.
@@ -8695,7 +9036,7 @@ when it might be a symlink to a directory.
Otherwise, @command{mv} may do something very surprising, since
its behavior depends on the underlying rename system call.
On a system with a modern Linux-based kernel, it fails with
-@code{errno=ENOTDIR}.
+@code{errno=ENOTDIR}@.
However, on other systems (at least FreeBSD 6.1 and Solaris 10) it silently
renames not the symlink but rather the directory referenced by the symlink.
@xref{Trailing slashes}.
@@ -8806,6 +9147,13 @@ The program accepts the following options. Also see @ref{Common options}.
@table @samp
+@item -d
+@itemx --dir
+@opindex -d
+@opindex --dir
+@cindex directories, removing
+Remove the listed directories if they are empty.
+
@item -f
@itemx --force
@opindex -f
@@ -8827,7 +9175,7 @@ files are named or if a recursive removal is requested. Ignore any
previous @option{--force} (@option{-f}) option. Equivalent to
@option{--interactive=once}.
-@itemx --interactive [=@var{when}]
+@item --interactive [=@var{when}]
@opindex --interactive
Specify when to issue an interactive prompt. @var{when} may be
omitted, or one of:
@@ -8846,7 +9194,7 @@ removal is requested. Equivalent to @option{-I}.
@option{--interactive} with no @var{when} is equivalent to
@option{--interactive=always}.
-@itemx --one-file-system
+@item --one-file-system
@opindex --one-file-system
@cindex one file system, restricting @command{rm} to
When removing a hierarchy recursively, skip any directory that is on a
@@ -8865,7 +9213,7 @@ warn about and skip directories on other file systems.
Of course, this will not save your @file{/home} if it and your
chroot happen to be on the same file system.
-@itemx --preserve-root
+@item --preserve-root
@opindex --preserve-root
@cindex root directory, disallow recursive destruction
Fail upon any attempt to remove the root directory, @file{/},
@@ -8873,7 +9221,7 @@ when used with the @option{--recursive} option.
This is the default behavior.
@xref{Treating / specially}.
-@itemx --no-preserve-root
+@item --no-preserve-root
@opindex --no-preserve-root
@cindex root directory, allow recursive destruction
Do not treat @file{/} specially when removing recursively.
@@ -8901,7 +9249,7 @@ Print the name of each file before removing it.
@cindex files beginning with @samp{-}, removing
@cindex @samp{-}, removing files beginning with
One common question is how to remove files whose names begin with a
-@samp{-}. @sc{gnu} @command{rm}, like every program that uses the @code{getopt}
+@samp{-}. GNU @command{rm}, like every program that uses the @code{getopt}
function to parse its arguments, lets you use the @samp{--} option to
indicate that all following arguments are non-options. To remove a file
called @file{-f} in the current directory, you could type either:
@@ -8963,7 +9311,7 @@ floppies, the patterns are designed for best effect on hard drives.
For more details, see the source code and Peter Gutmann's paper
@uref{http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html,
@cite{Secure Deletion of Data from Magnetic and Solid-State Memory}},
-from the proceedings of the Sixth @acronym{USENIX} Security Symposium (San Jose,
+from the proceedings of the Sixth USENIX Security Symposium (San Jose,
California, July 22--25, 1996).
@strong{Please note} that @command{shred} relies on a very important assumption:
@@ -8976,7 +9324,7 @@ assumption. Exceptions include:
@item
Log-structured or journaled file systems, such as those supplied with
AIX and Solaris, and JFS, ReiserFS, XFS, Ext3 (in @code{data=journal} mode),
-BFS, NTFS, etc.@: when they are configured to journal @emph{data}.
+BFS, NTFS, etc., when they are configured to journal @emph{data}.
@item
File systems that write redundant data and carry on even if some writes
@@ -8995,7 +9343,7 @@ Compressed file systems.
In the particular case of ext3 file systems, the above disclaimer applies (and
@command{shred} is thus of limited effectiveness) only in @code{data=journal}
-mode, which journals file data in addition to just metadata. In both
+mode, which journals file data in addition to just metadata. In both
the @code{data=ordered} (default) and @code{data=writeback} modes,
@command{shred} works as usual. Ext3 journaling modes can be changed
by adding the @code{data=something} option to the mount options for a
@@ -9048,8 +9396,8 @@ Override file permissions if necessary to allow overwriting.
@opindex --iterations=@var{number}
@cindex iterations, selecting the number of
By default, @command{shred} uses @value{SHRED_DEFAULT_PASSES} passes of
-overwrite. You can reduce this to save time, or increase it if you think it's
-appropriate. After 25 passes all of the internal overwrite patterns will have
+overwrite. You can reduce this to save time, or increase it if you think it's
+appropriate. After 25 passes all of the internal overwrite patterns will have
been used at least once.
@item --random-source=@var{file}
@@ -9217,10 +9565,10 @@ must specify a nonexistent entry in an existing directory.
@command{link} simply calls @code{link (@var{filename}, @var{linkname})}
to create the link.
-On a @acronym{GNU} system, this command acts like @samp{ln --directory
+On a GNU system, this command acts like @samp{ln --directory
--no-target-directory @var{filename} @var{linkname}}. However, the
@option{--directory} and @option{--no-target-directory} options are
-not specified by @acronym{POSIX}, and the @command{link} command is
+not specified by POSIX, and the @command{link} command is
more portable in practice.
If @var{filename} is a symbolic link, it is unspecified whether
@@ -9287,7 +9635,7 @@ file. Most systems prohibit making a hard link to
a directory; on those where it is allowed, only the super-user can do
so (and with caution, since creating a cycle will cause problems to many
other utilities). Hard links cannot cross file system boundaries. (These
-restrictions are not mandated by @acronym{POSIX}, however.)
+restrictions are not mandated by POSIX, however.)
@cindex dereferencing symbolic links
@cindex symbolic link, defined
@@ -9508,7 +9856,7 @@ in @command{chmod} and uses @samp{a=rwx} (read, write and execute allowed for
everyone) for the point of the departure. @xref{File permissions}.
Normally the directory has the desired file mode bits at the moment it
-is created. As a @acronym{GNU} extension, @var{mode} may also mention
+is created. As a GNU extension, @var{mode} may also mention
special mode bits, but in this case there may be a temporary window
during which the directory exists but its special mode bits are
incorrect. @xref{Directory Setuid and Setgid}, for how the
@@ -9700,20 +10048,20 @@ Set the default SELinux security context to be used for created files.
@item Readlink mode
-@command{readlink} outputs the value of the given symbolic link.
+@command{readlink} outputs the value of the given symbolic links.
If @command{readlink} is invoked with an argument other than the name
of a symbolic link, it produces no output and exits with a nonzero exit code.
@item Canonicalize mode
-@command{readlink} outputs the absolute name of the given file which contains
+@command{readlink} outputs the absolute name of the given files which contain
no @file{.}, @file{..} components nor any repeated separators
(@file{/}) or symbolic links.
@end table
@example
-readlink [@var{option}] @var{file}
+readlink [@var{option}]@dots{} @var{file}@dots{}
@end example
By default, @command{readlink} operates in readlink mode.
@@ -9752,7 +10100,8 @@ as a directory.
@itemx --no-newline
@opindex -n
@opindex --no-newline
-Do not output the trailing newline.
+Do not print the output delimiter, when a single @var{file} is specified.
+Print a warning if specified along with multiple @var{file}s.
@item -s
@itemx -q
@@ -9770,6 +10119,12 @@ Suppress most error messages.
@opindex --verbose
Report error messages.
+@item -z
+@itemx --zero
+@opindex -z
+@opindex --zero
+Separate output items with NUL characters.
+
@end table
The @command{readlink} utility first appeared in OpenBSD 2.1.
@@ -9878,9 +10233,9 @@ timestamps, and other information. Collectively, we call these a file's
These commands change file attributes.
@menu
+* chown invocation:: Change file owners and groups.
* chgrp invocation:: Change file groups.
* chmod invocation:: Change access permissions.
-* chown invocation:: Change file owners and groups.
* touch invocation:: Change file timestamps.
@end menu
@@ -9944,8 +10299,8 @@ or group ID, then you may specify it with a leading @samp{+}.
@xref{Disambiguating names and IDs}.
Some older scripts may still use @samp{.} in place of the @samp{:} separator.
-@acronym{POSIX} 1003.1-2001 (@pxref{Standards conformance}) does not
-require support for that, but for backward compatibility @acronym{GNU}
+POSIX 1003.1-2001 (@pxref{Standards conformance}) does not
+require support for that, but for backward compatibility GNU
@command{chown} supports @samp{.} so long as no ambiguity results.
New scripts should avoid the use of @samp{.} because it is not
portable, and because it has undesirable results if the entire
@@ -9985,7 +10340,7 @@ actually changes.
Do not print error messages about files whose ownership cannot be
changed.
-@itemx @w{@kbd{--from}=@var{old-owner}}
+@item @w{@kbd{--from}=@var{old-owner}}
@opindex --from
@cindex symbolic links, changing owner
Change a @var{file}'s ownership only if it has current attributes specified
@@ -10039,14 +10394,14 @@ is a symbolic link.
By default, no diagnostic is issued for symbolic links encountered
during a recursive traversal, but see @option{--verbose}.
-@itemx --preserve-root
+@item --preserve-root
@opindex --preserve-root
@cindex root directory, disallow recursive modification
Fail upon any attempt to recursively change the root directory, @file{/}.
Without @option{--recursive}, this option has no effect.
@xref{Treating / specially}.
-@itemx --no-preserve-root
+@item --no-preserve-root
@opindex --no-preserve-root
@cindex root directory, allow recursive modification
Cancel the effect of any preceding @option{--preserve-root} option.
@@ -10166,14 +10521,14 @@ is a symbolic link.
By default, no diagnostic is issued for symbolic links encountered
during a recursive traversal, but see @option{--verbose}.
-@itemx --preserve-root
+@item --preserve-root
@opindex --preserve-root
@cindex root directory, disallow recursive modification
Fail upon any attempt to recursively change the root directory, @file{/}.
Without @option{--recursive}, this option has no effect.
@xref{Treating / specially}.
-@itemx --no-preserve-root
+@item --no-preserve-root
@opindex --no-preserve-root
@cindex root directory, allow recursive modification
Cancel the effect of any preceding @option{--preserve-root} option.
@@ -10288,14 +10643,14 @@ actually changes.
Do not print error messages about files whose permissions cannot be
changed.
-@itemx --preserve-root
+@item --preserve-root
@opindex --preserve-root
@cindex root directory, disallow recursive modification
Fail upon any attempt to recursively change the root directory, @file{/}.
Without @option{--recursive}, this option has no effect.
@xref{Treating / specially}.
-@itemx --no-preserve-root
+@item --no-preserve-root
@opindex --no-preserve-root
@cindex root directory, allow recursive modification
Cancel the effect of any preceding @option{--preserve-root} option.
@@ -10409,7 +10764,7 @@ environment variable, or by the system default rules if @env{TZ} is
not set. @xref{TZ Variable,, Specifying the Time Zone with @env{TZ},
libc, The GNU C Library Reference Manual}.
You can avoid ambiguities during
-daylight saving transitions by using @sc{utc} time stamps.
+daylight saving transitions by using UTC time stamps.
The program accepts the following options. Also see @ref{Common options}.
@@ -10442,7 +10797,7 @@ time zones, @samp{am} and @samp{pm}, @samp{yesterday}, etc. For
example, @option{--date="2004-02-27 14:19:13.489392193 +0530"}
specifies the instant of time that is 489,392,193 nanoseconds after
February 27, 2004 at 2:19:13 PM in a time zone that is 5 hours and 30
-minutes east of @acronym{UTC}. @xref{Date input formats}.
+minutes east of UTC@. @xref{Date input formats}.
File systems that do not support high-resolution time stamps
silently ignore any excess precision here.
@@ -10462,7 +10817,7 @@ the link refers to. When using this option, empty files are not
created, but option @option{-c} must also be used to avoid warning
about files that do not exist. Not all systems support changing the
timestamps of symlinks, since underlying system support for this
-action was not required until @acronym{POSIX} 2008. Also, on some
+action was not required until POSIX 2008. Also, on some
systems, the mere act of examining a symbolic link changes the access
time, such that only changes to the modification time will persist
long enough to be observable. When coupled with option @option{-r}, a
@@ -10492,13 +10847,15 @@ If @var{file} is a symbolic link, the reference timestamp is taken
from the target of the symlink, unless @option{-h} was also in effect.
@item -t [[@var{cc}]@var{yy}]@var{mmddhhmm}[.@var{ss}]
+@cindex leap seconds
Use the argument (optional four-digit or two-digit years, months,
days, hours, minutes, optional seconds) instead of the current time.
If the year is specified with only two digits, then @var{cc}
is 20 for years in the range 0 @dots{} 68, and 19 for years in
69 @dots{} 99. If no digits of the year are specified,
the argument is interpreted as a date in the current year.
-Note that @var{ss} may be @samp{60}, to accommodate leap seconds.
+On the atypical systems that support leap seconds, @var{ss} may be
+@samp{60}.
@end table
@@ -10561,12 +10918,22 @@ Normally the disk 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.
+For bind mounts and without arguments, @command{df} only outputs the statistics
+for that device with the shortest mount point name in the list of file systems
+(@var{mtab}), i.e., it hides duplicate entries, unless the @option{-a} option is
+specified.
+
+With the same logic, @command{df} elides a mount entry of a dummy pseude device
+if there is another mount entry of a real block device for that mount point with
+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
If an argument @var{file} is a disk device 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 (i.e., the root
-file system). @sc{gnu} @command{df} does not attempt to determine the
+file system). GNU @command{df} does not attempt to determine the
disk usage
on unmounted file systems, because on most kinds of systems doing so
requires extremely nonportable intimate knowledge of file system
@@ -10594,13 +10961,19 @@ pseudo-file-systems, such as automounter entries.
Scale sizes by @var{size} before printing them (@pxref{Block size}).
For example, @option{-BG} prints sizes in units of 1,073,741,824 bytes.
-@itemx --total
+@item --total
@opindex --total
@cindex grand total of disk 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
and available space of all listed devices.
+For the grand total line, @command{df} prints @samp{"total"} into the
+@var{source} column, and @samp{"-"} into the @var{target} column.
+If there is no @var{source} column (see @option{--output}), then
+@command{df} prints @samp{"total"} into the @var{target} column,
+if present.
+
@optHumanReadable
@item -H
@@ -10639,15 +11012,76 @@ This may make @command{df} run significantly faster on systems with many
disks, but on some systems (notably SunOS) the results may be slightly
out of date. This is the default.
+@item --output
+@itemx @w{@kbd{--output}[=@var{field_list}]}
+@opindex --output
+Use the output format defined by @var{field_list}, or print all fields if
+@var{field_list} is omitted. In the latter case, the order of the columns
+conforms to the order of the field descriptions below.
+
+The use of the @option{--output} together with each of the options @option{-i},
+@option{-P}, and @option{-T} is mutually exclusive.
+
+FIELD_LIST is a comma-separated list of columns to be included in @command{df}'s
+output and therefore effectively controls the order of output columns.
+Each field can thus be used at the place of choice, but yet must only be
+used once.
+
+Valid field names in the @var{field_list} are:
+@table @samp
+@item source
+The source of the mount point, usually a device.
+@item fstype
+File system type.
+
+@item itotal
+Total number of inodes.
+@item iused
+Number of used inodes.
+@item iavail
+Number of available inodes.
+@item ipcent
+Percentage of @var{iused} divided by @var{itotal}.
+
+@item size
+Total number of blocks.
+@item used
+Number of used blocks.
+@item avail
+Number of available blocks.
+@item pcent
+Percentage of @var{used} divided by @var{size}.
+
+@item target
+The mount point.
+@end table
+
+The fields for block and inodes statistics are affected by the scaling
+options like @option{-h} as usual.
+
+The definition of the @var{field_list} can even be splitted among several
+@option{--output} uses.
+
+@example
+#!/bin/sh
+# Print the TARGET (i.e., the mount point) along with their percentage
+# statistic regarding the blocks and the inodes.
+df --out=target --output=pcent,ipcent
+
+# Print all available fields.
+df --o
+@end example
+
+
@item -P
@itemx --portability
@opindex -P
@opindex --portability
@cindex one-line output format
-@cindex @acronym{POSIX} output format
+@cindex POSIX output format
@cindex portable output format
@cindex output format, portable
-Use the @acronym{POSIX} output format. This is like the default format except
+Use the POSIX output format. This is like the default format except
for the following:
@enumerate
@@ -10658,7 +11092,7 @@ that if the mount device name is more than 20 characters long (e.g., for
some network mounts), the columns are misaligned.
@item
-The labels in the header output line are changed to conform to @acronym{POSIX}.
+The labels in the header output line are changed to conform to POSIX.
@item
The default block size and output format are unaffected by the
@@ -10700,8 +11134,8 @@ the common names (this list is certainly not exhaustive):
@table @samp
@item nfs
-@cindex @acronym{NFS} file system type
-An @acronym{NFS} file system, i.e., one mounted over a network from another
+@cindex NFS file system type
+An NFS file system, i.e., one mounted over a network from another
machine. This is the one type name which seems to be used uniformly by
all systems.
@@ -10751,6 +11185,11 @@ inspect the exit status of a command like @samp{df -t ext3 -t reiserfs
@var{dir}} to test whether @var{dir} is on a file system of type
@samp{ext3} or @samp{reiserfs}.
+Since the list of file systems (@var{mtab}) is needed to determine the
+file system type, failure includes the cases when that list cannot
+be read and one or more of the options @option{-a}, @option{-l}, @option{-t}
+or @option{-x} is used together with a file name argument.
+
@node du invocation
@section @command{du}: Estimate file space usage
@@ -10780,13 +11219,15 @@ The program accepts the following options. Also see @ref{Common options}.
@table @samp
+@optNull{du}
+
@item -a
@itemx --all
@opindex -a
@opindex --all
Show counts for all files, not just directories.
-@itemx --apparent-size
+@item --apparent-size
@opindex --apparent-size
Print apparent sizes, rather than disk usage. The apparent size of a
file is the number of bytes reported by @code{wc -c} on regular files,
@@ -10805,12 +11246,6 @@ dd bs=1 seek=2GiB if=/dev/null of=big
has an apparent size of 2 GiB, yet on most modern
systems, it actually uses almost no disk space.
-@item -b
-@itemx --bytes
-@opindex -b
-@opindex --bytes
-Equivalent to @code{--apparent-size --block-size=1}.
-
@item -B @var{size}
@itemx --block-size=@var{size}
@opindex -B
@@ -10819,6 +11254,12 @@ Equivalent to @code{--apparent-size --block-size=1}.
Scale sizes by @var{size} before printing them (@pxref{Block size}).
For example, @option{-BG} prints sizes in units of 1,073,741,824 bytes.
+@item -b
+@itemx --bytes
+@opindex -b
+@opindex --bytes
+Equivalent to @code{--apparent-size --block-size=1}.
+
@item -c
@itemx --total
@opindex -c
@@ -10837,15 +11278,24 @@ Does not affect other symbolic links. This is helpful for finding
out the disk usage of directories, such as @file{/usr/tmp}, which
are often symbolic links.
+@item -d @var{depth}
+@itemx --max-depth=@var{depth}
+@opindex -d @var{depth}
+@opindex --max-depth=@var{depth}
+@cindex limiting output of @command{du}
+Show the total for each directory (and file if --all) that is at
+most MAX_DEPTH levels down from the root of the hierarchy. The root
+is at level 0, so @code{du --max-depth=0} is equivalent to @code{du -s}.
+
@c --files0-from=FILE
@filesZeroFromOption{du,, with the @option{--total} (@option{-c}) option}
-@optHumanReadable
-
@item -H
@opindex -H
Equivalent to @option{--dereference-args} (@option{-D}).
+@optHumanReadable
+
@item -k
@opindex -k
@cindex kibibytes for file sizes
@@ -10853,14 +11303,6 @@ Print sizes in 1024-byte blocks, overriding the default block size
(@pxref{Block size}).
This option is equivalent to @option{--block-size=1K}.
-@item -l
-@itemx --count-links
-@opindex -l
-@opindex --count-links
-@cindex hard links, counting in @command{du}
-Count the size of all files, even if they have appeared already (as a
-hard link).
-
@item -L
@itemx --dereference
@opindex -L
@@ -10870,6 +11312,14 @@ Dereference symbolic links (show the disk space used by the file
or directory that the link points to instead of the space used by
the link).
+@item -l
+@itemx --count-links
+@opindex -l
+@opindex --count-links
+@cindex hard links, counting in @command{du}
+Count the size of all files, even if they have appeared already (as a
+hard link).
+
@item -m
@opindex -m
@cindex mebibytes for file sizes
@@ -10885,25 +11335,6 @@ This option is equivalent to @option{--block-size=1M}.
For each symbolic links encountered by @command{du},
consider the disk space used by the symbolic link.
-@item -d @var{depth}
-@item --max-depth=@var{depth}
-@opindex -d @var{depth}
-@opindex --max-depth=@var{depth}
-@cindex limiting output of @command{du}
-Show the total for each directory (and file if --all) that is at
-most MAX_DEPTH levels down from the root of the hierarchy. The root
-is at level 0, so @code{du --max-depth=0} is equivalent to @code{du -s}.
-
-@optNull{du}
-
-@optSi
-
-@item -s
-@itemx --summarize
-@opindex -s
-@opindex --summarize
-Display only a total for each argument.
-
@item -S
@itemx --separate-dirs
@opindex -S
@@ -10915,13 +11346,56 @@ With @option{--separate-dirs}, the size reported for a directory name,
@var{d}, is merely the @code{stat.st_size}-derived size of the directory
entry, @var{d}.
-@itemx --time
+@optSi
+
+@item -s
+@itemx --summarize
+@opindex -s
+@opindex --summarize
+Display only a total for each argument.
+
+@item -t @var{size}
+@itemx --threshold=@var{size}
+@opindex -t
+@opindex --threshold
+Exclude entries based on a given @var{size} (@pxref{Block size}).
+
+If @var{size} is positive, then @command{du} will only print entries with a size
+greater than or equal to that.
+
+If @var{size} is negative, then @command{du} will only print entries with a size
+smaller than or equal to that.
+
+Although GNU @command{find} can be used to find files of a certain size,
+@command{du}'s @option{--threshold} option can be used to also filter
+directories based on a given size.
+
+Please note that the @option{--threshold} option can be combined with the
+@option{--apparent-size} option, and in this case would elide entries based on
+its apparent size.
+
+Here's how you would use @option{--threshold} to find directories with a size
+greater than or equal to 200 megabytes:
+
+@example
+du --threshold=200MB
+@end example
+
+Here's how you would use @option{--threshold} to find directories and files -
+note the @option{-a} - with an apparent size smaller than or equal to 500 bytes:
+
+@example
+du -a -t -500 --apparent-size
+@end example
+
+
+@item --time
@opindex --time
@cindex last modified dates, displaying in @command{du}
Show time of the most recent modification of any file in the directory,
or any of its subdirectories.
-@itemx --time=ctime
+@item --time=ctime
@itemx --time=status
@itemx --time=use
@opindex --time
@@ -10931,7 +11405,7 @@ or any of its subdirectories.
Show the most recent status change time (the @samp{ctime} in the inode) of
any file in the directory, instead of the modification time.
-@itemx --time=atime
+@item --time=atime
@itemx --time=access
@opindex --time
@opindex atime@r{, show the most recent}
@@ -10957,19 +11431,19 @@ with @command{date}, @var{format}'s interpretation is affected by the
@env{LC_TIME} locale category.
@item full-iso
-List timestamps in full using @acronym{ISO} 8601 date, time, and time zone
+List timestamps in full using ISO 8601 date, time, and time zone
format with nanosecond precision, e.g., @samp{2002-03-30
23:45:56.477817180 -0700}. This style is equivalent to
@samp{+%Y-%m-%d %H:%M:%S.%N %z}.
@item long-iso
-List @acronym{ISO} 8601 date and time in minutes, e.g.,
+List ISO 8601 date and time in minutes, e.g.,
@samp{2002-03-30 23:45}. These timestamps are shorter than
@samp{full-iso} timestamps, and are usually good enough for everyday
work. This style is equivalent to @samp{+%Y-%m-%d %H:%M}.
@item iso
-List @acronym{ISO} 8601 dates for timestamps, e.g., @samp{2002-03-30}.
+List ISO 8601 dates for timestamps, e.g., @samp{2002-03-30}.
This style is equivalent to @samp{+%Y-%m-%d}.
@end table
@@ -10982,21 +11456,6 @@ the newline and any later characters are ignored; if @env{TIME_STYLE}
begins with @samp{posix-} the @samp{posix-} is ignored; and if
@env{TIME_STYLE} is @samp{locale} it is ignored.
-@item -x
-@itemx --one-file-system
-@opindex -x
-@opindex --one-file-system
-@cindex one file system, restricting @command{du} to
-Skip directories that are on different file systems from the one that
-the argument being processed is on.
-
-@item --exclude=@var{pattern}
-@opindex --exclude=@var{pattern}
-@cindex excluding files from @command{du}
-When recursing, skip subdirectories or files matching @var{pattern}.
-For example, @code{du --exclude='*.o'} excludes files whose names
-end in @samp{.o}.
-
@item -X @var{file}
@itemx --exclude-from=@var{file}
@opindex -X @var{file}
@@ -11006,6 +11465,21 @@ Like @option{--exclude}, except take the patterns to exclude from @var{file},
one per line. If @var{file} is @samp{-}, take the patterns from standard
input.
+@item --exclude=@var{pattern}
+@opindex --exclude=@var{pattern}
+@cindex excluding files from @command{du}
+When recursing, skip subdirectories or files matching @var{pattern}.
+For example, @code{du --exclude='*.o'} excludes files whose names
+end in @samp{.o}.
+
+@item -x
+@itemx --one-file-system
+@opindex -x
+@opindex --one-file-system
+@cindex one file system, restricting @command{du} to
+Skip directories that are on different file systems from the one that
+the argument being processed is on.
+
@end table
@cindex NFS mounts from BSD to HP-UX
@@ -11074,7 +11548,7 @@ $ stat --format=%d:%i / /usr
2057:2
@end example
-@itemx --printf=@var{format}
+@item --printf=@var{format}
@opindex --printf=@var{format}
@cindex output format
Use @var{format} rather than the default format.
@@ -11139,7 +11613,7 @@ precision preceded by a period to specify the number of digits to
print after the decimal point. For example, @samp{%.3X} outputs the
last access time to millisecond precision. If a period is given but no
precision, @command{stat} uses 9 digits, so @samp{%.X} is equivalent to
-@samp{%.9X}. When discarding excess precision, time stamps are truncated
+@samp{%.9X}@. When discarding excess precision, time stamps are truncated
toward minus infinity.
@example
@@ -11236,7 +11710,7 @@ Any arguments are ignored, except for a lone @option{--help} or
@cindex truncating, file sizes
@command{truncate} shrinks or extends the size of each @var{file} to the
-specified size. Synopsis:
+specified size. Synopsis:
@example
truncate @var{option}@dots{} @var{file}@dots{}
@@ -11395,7 +11869,7 @@ option-like arguments instead of treating them as options. For
example, @code{echo -ne hello} outputs @samp{-ne hello} instead of
plain @samp{hello}.
-@acronym{POSIX} does not require support for any options, and says
+POSIX does not require support for any options, and says
that the behavior of @command{echo} is implementation-defined if any
@var{string} contains a backslash or if the first argument is
@option{-n}. Portable programs can use the @command{printf} command
@@ -11471,8 +11945,8 @@ then its value is the numeric value of the immediately following
character. Any remaining characters are silently ignored if the
@env{POSIXLY_CORRECT} environment variable is set; otherwise, a
warning is printed. For example, @samp{printf "%d" "'a"} outputs
-@samp{97} on hosts that use the @acronym{ASCII} character set, since
-@samp{a} has the numeric value 97 in @acronym{ASCII}.
+@samp{97} on hosts that use the ASCII character set, since
+@samp{a} has the numeric value 97 in ASCII.
@end itemize
@@ -11500,15 +11974,15 @@ For example, @samp{printf '\400'} is equivalent to @samp{printf '\0'}.
@cindex ISO/IEC 10646
@vindex LC_CTYPE
@command{printf} interprets two character syntaxes introduced in
-@acronym{ISO} C 99:
-@samp{\u} for 16-bit Unicode (@acronym{ISO}/@acronym{IEC} 10646)
+ISO C 99:
+@samp{\u} for 16-bit Unicode (ISO/IEC 10646)
characters, specified as
four hexadecimal digits @var{hhhh}, and @samp{\U} for 32-bit Unicode
characters, specified as eight hexadecimal digits @var{hhhhhhhh}.
@command{printf} outputs the Unicode characters
according to the @env{LC_CTYPE} locale. Unicode characters in the ranges
-U+0000...U+009F, U+D800...U+DFFF cannot be specified by this syntax, except
-for U+0024 ($), U+0040 (@@), and U+0060 (@`).
+U+0000@dots{}U+009F, U+D800@dots{}U+DFFF cannot be specified by this syntax,
+except for U+0024 ($), U+0040 (@@), and U+0060 (@`).
The processing of @samp{\u} and @samp{\U} requires a full-featured
@code{iconv} facility. It is activated on systems with glibc 2.2 (or newer),
@@ -11528,7 +12002,7 @@ $ env printf '\u20AC 14.95'
@noindent
will be output correctly in all locales supporting the Euro symbol
-(@acronym{ISO}-8859-15, UTF-8, and others). Similarly, a Chinese string
+(ISO-8859-15, UTF-8, and others). Similarly, a Chinese string
@example
$ env printf '\u4e2d\u6587'
@@ -11542,7 +12016,7 @@ invoked via @command{env} to ensure that we run the program found via
your shell's search path, and not a shell alias or a built-in function.
For larger strings, you don't need to look up the hexadecimal code
-values of each character one by one. @acronym{ASCII} characters mixed with \u
+values of each character one by one. ASCII characters mixed with \u
escape sequences is also known as the JAVA source file encoding. You can
use GNU recode 3.5c (or newer) to convert strings to this encoding. Here
is how to convert a piece of text into a shell script which will output
@@ -11624,7 +12098,7 @@ exits unsuccessfully, even when invoked with
Portable programs should not assume that the exit status of
@command{false} is 1, as it is greater than 1 on some
-non-@acronym{GNU} hosts.
+non-GNU hosts.
@node true invocation
@@ -12018,7 +12492,7 @@ e.g., spaces. However, regardless of whether it is quoted, a string
operand should not be a parenthesis or any of @command{expr}'s
operators like @code{+}, so you cannot safely pass an arbitrary string
@code{$str} to expr merely by quoting it to the shell. One way to
-work around this is to use the @sc{gnu} extension @code{+},
+work around this is to use the GNU extension @code{+},
(e.g., @code{+ "$str" = foo}); a more portable way is to use
@code{@w{" $str"}} and to adjust the rest of the expression to take
the leading space into account (e.g., @code{@w{" $str" = " foo"}}).
@@ -12100,7 +12574,7 @@ expression operators.
In the regular expression, @code{\+}, @code{\?}, and @code{\|} are
operators which respectively match one or more, zero or one, or separate
alternatives. SunOS and other @command{expr}'s treat these as regular
-characters. (@acronym{POSIX} allows either behavior.)
+characters. (POSIX allows either behavior.)
@xref{Top, , Regular Expression Library, regex, Regex}, for details of
regular expression syntax. Some examples are in @ref{Examples of expr}.
@@ -12132,7 +12606,7 @@ or an operator like @code{/}.
This makes it possible to test @code{expr length + "$x"} or
@code{expr + "$x" : '.*/\(.\)'} and have it do the right thing even if
the value of @var{$x} happens to be (for example) @code{/} or @code{index}.
-This operator is a @acronym{GNU} extension. Portable shell scripts should use
+This operator is a GNU extension. Portable shell scripts should use
@code{@w{" $token"} : @w{' \(.*\)'}} instead of @code{+ "$token"}.
@end table
@@ -12351,7 +12825,7 @@ checksum in a file named @file{dvd.sha1}.
Note, however, that this example relies on a feature of modern shells
called @dfn{process substitution}
(the @samp{>(command)} syntax, above;
-@xref{Process Substitution,,Process Substitution, bashref,
+@xref{Process Substitution,,Process Substitution, bash,
The Bash Reference Manual}.),
so it works with @command{zsh}, @command{bash}, and @command{ksh},
but not with @command{/bin/sh}. So if you write code like this
@@ -12461,7 +12935,7 @@ This section describes commands that manipulate file names.
@example
basename @var{name} [@var{suffix}]
-basename @var{option}... @var{name}...
+basename @var{option}@dots{} @var{name}@dots{}
@end example
If @var{suffix} is specified and is identical to the end of @var{name},
@@ -12479,8 +12953,8 @@ for everything except file names containing a trailing newline.
@end macro
@basenameAndDirname
-@acronym{POSIX} allows the implementation to define the results if
-@var{name} is empty or @samp{//}. In the former case, @acronym{GNU}
+POSIX allows the implementation to define the results if
+@var{name} is empty or @samp{//}. In the former case, GNU
@command{basename} returns the empty string. In the latter case, the
result is @samp{//} on platforms where @var{//} is distinct from
@var{/}, and @samp{/} on platforms where there is no difference.
@@ -12509,7 +12983,7 @@ This option implies the @option{-a} option.
@itemx --zero
@opindex -z
@opindex --zero
-Separate output items with @sc{nul} characters.
+Separate output items with NUL characters.
@end table
@@ -12546,7 +13020,7 @@ also removed. If the string contains no slash, @command{dirname}
prints @samp{.} (meaning the current directory). Synopsis:
@example
-dirname [@var{option}] @var{name}...
+dirname [@var{option}] @var{name}@dots{}
@end example
@var{name} need not be a file name, but if it is, this operation
@@ -12555,8 +13029,8 @@ including the case when the final component is itself a directory.
@basenameAndDirname
-@acronym{POSIX} allows the implementation to define the results if
-@var{name} is @samp{//}. With @acronym{GNU} @command{dirname}, the
+POSIX allows the implementation to define the results if
+@var{name} is @samp{//}. With GNU @command{dirname}, the
result is @samp{//} on platforms where @var{//} is distinct from
@var{/}, and @samp{/} on platforms where there is no difference.
@@ -12568,7 +13042,7 @@ The program accepts the following option. Also see @ref{Common options}.
@itemx --zero
@opindex -z
@opindex --zero
-Separate output items with @sc{nul} characters.
+Separate output items with NUL characters.
@end table
@@ -12636,13 +13110,13 @@ print an error message if any of these conditions is true:
A file name is empty.
@item
-A file name contains a character outside the @acronym{POSIX} portable file
+A file name contains a character outside the POSIX portable file
name character set, namely, the ASCII letters and digits, @samp{.},
@samp{_}, @samp{-}, and @samp{/}.
@item
The length of a file name or one of its components exceeds the
-@acronym{POSIX} minimum limits for portability.
+POSIX minimum limits for portability.
@end enumerate
@item -P
@@ -12652,7 +13126,7 @@ that begins with @samp{-}.
@item --portability
@opindex --portability
-Print an error message if a file name is not portable to all @acronym{POSIX}
+Print an error message if a file name is not portable to all POSIX
hosts. This option is equivalent to @samp{-p -P}.
@end table
@@ -12916,16 +13390,16 @@ only on the file name, and does not touch any actual file.
@itemx --zero
@opindex -z
@opindex --zero
-Separate output items with @sc{nul} characters.
+Separate output items with NUL characters.
-@itemx --relative-to=@var{file}
+@item --relative-to=@var{file}
@opindex --relative-to
@cindex relpath
Print the resolved file names relative to the specified file.
Note this option honors the @option{-m} and @option{-e} options
pertaining to file existence.
-@itemx --relative-base=@var{base}
+@item --relative-base=@var{base}
@opindex --relative-base
This option is valid when used with @option{--relative-to}, and will restrict
the output of @option{--relative-to} so that relative names are output,
@@ -13064,8 +13538,8 @@ be used in combination with any line settings.
@opindex --file
Set the line opened by the file name specified in @var{device} instead of
the tty line connected to standard input. This option is necessary
-because opening a @acronym{POSIX} tty requires use of the
-@code{O_NONDELAY} flag to prevent a @acronym{POSIX} tty from blocking
+because opening a POSIX tty requires use of the
+@code{O_NONDELAY} flag to prevent a POSIX tty from blocking
until the carrier detect line is high if
the @code{clocal} flag is not set. Hence, it is not always possible
to allow the shell to open the device in the traditional manner.
@@ -13087,9 +13561,9 @@ description. The descriptions themselves refer to the positive
case, that is, when @emph{not} negated (unless stated otherwise,
of course).
-Some settings are not available on all @acronym{POSIX} systems, since they use
+Some settings are not available on all POSIX systems, since they use
extensions. Such arguments are marked below with
-``Non-@acronym{POSIX}'' in their description. On non-@acronym{POSIX}
+``Non-POSIX'' in their description. On non-POSIX
systems, those or other settings also may not
be available, but it's not feasible to document all the variations: just
try it and see.
@@ -13160,7 +13634,14 @@ Disable modem control signals. May be negated.
@cindex hardware flow control
@cindex flow control, hardware
@cindex RTS/CTS flow control
-Enable RTS/CTS flow control. Non-@acronym{POSIX}. May be negated.
+Enable RTS/CTS flow control. Non-POSIX@. May be negated.
+
+@item cdtrdsr
+@opindex cdtrdsr
+@cindex hardware flow control
+@cindex flow control, hardware
+@cindex DTR/DSR flow control
+Enable DTR/DSR flow control. Non-POSIX@. May be negated.
@end table
@@ -13240,20 +13721,20 @@ empty again. May be negated.
@item iuclc
@opindex iuclc
@cindex uppercase, translating to lowercase
-Translate uppercase characters to lowercase. Non-@acronym{POSIX}. May be
-negated. Note ilcuc is not implemented, as one would not be able to issue
+Translate uppercase characters to lowercase. Non-POSIX@. May be
+negated. Note ilcuc is not implemented, as one would not be able to issue
almost any (lowercase) Unix command, after invoking it.
@item ixany
@opindex ixany
Allow any character to restart output (only the start character
-if negated). Non-@acronym{POSIX}. May be negated.
+if negated). Non-POSIX@. May be negated.
@item imaxbel
@opindex imaxbel
@cindex beeping at input buffer full
Enable beeping and not flushing input buffer if a character arrives
-when the input buffer is full. Non-@acronym{POSIX}. May be negated.
+when the input buffer is full. Non-POSIX@. May be negated.
@end table
@@ -13271,76 +13752,76 @@ Postprocess output. May be negated.
@item olcuc
@opindex olcuc
@cindex lowercase, translating to output
-Translate lowercase characters to uppercase. Non-@acronym{POSIX}. May be
-negated. (Note ouclc is not currently implemented.)
+Translate lowercase characters to uppercase. Non-POSIX@. May be
+negated. (Note ouclc is not currently implemented.)
@item ocrnl
@opindex ocrnl
@cindex return, translating to newline
-Translate carriage return to newline. Non-@acronym{POSIX}. May be negated.
+Translate carriage return to newline. Non-POSIX@. May be negated.
@item onlcr
@opindex onlcr
@cindex newline, translating to crlf
-Translate newline to carriage return-newline. Non-@acronym{POSIX}. May be
+Translate newline to carriage return-newline. Non-POSIX@. May be
negated.
@item onocr
@opindex onocr
-Do not print carriage returns in the first column. Non-@acronym{POSIX}.
+Do not print carriage returns in the first column. Non-POSIX@.
May be negated.
@item onlret
@opindex onlret
-Newline performs a carriage return. Non-@acronym{POSIX}. May be negated.
+Newline performs a carriage return. Non-POSIX@. May be negated.
@item ofill
@opindex ofill
@cindex pad instead of timing for delaying
Use fill (padding) characters instead of timing for delays.
-Non-@acronym{POSIX}.
+Non-POSIX@.
May be negated.
@item ofdel
@opindex ofdel
@cindex pad character
-Use @acronym{ASCII} @sc{del} characters for fill instead of
-@acronym{ASCII} @sc{nul} characters. Non-@acronym{POSIX}.
+Use ASCII DEL characters for fill instead of
+ASCII NUL characters. Non-POSIX@.
May be negated.
@item nl1
@itemx nl0
@opindex nl@var{n}
-Newline delay style. Non-@acronym{POSIX}.
+Newline delay style. Non-POSIX.
@item cr3
@itemx cr2
@itemx cr1
@itemx cr0
@opindex cr@var{n}
-Carriage return delay style. Non-@acronym{POSIX}.
+Carriage return delay style. Non-POSIX.
@item tab3
@itemx tab2
@itemx tab1
@itemx tab0
@opindex tab@var{n}
-Horizontal tab delay style. Non-@acronym{POSIX}.
+Horizontal tab delay style. Non-POSIX.
@item bs1
@itemx bs0
@opindex bs@var{n}
-Backspace delay style. Non-@acronym{POSIX}.
+Backspace delay style. Non-POSIX.
@item vt1
@itemx vt0
@opindex vt@var{n}
-Vertical tab delay style. Non-@acronym{POSIX}.
+Vertical tab delay style. Non-POSIX.
@item ff1
@itemx ff0
@opindex ff@var{n}
-Form feed delay style. Non-@acronym{POSIX}.
+Form feed delay style. Non-POSIX.
@end table
@@ -13362,7 +13843,7 @@ special characters. May be negated.
@item iexten
@opindex iexten
-Enable non-@acronym{POSIX} special characters. May be negated.
+Enable non-POSIX special characters. May be negated.
@item echo
@opindex echo
@@ -13396,12 +13877,12 @@ characters. May be negated.
@cindex case translation
Enable input and output of uppercase characters by preceding their
lowercase equivalents with @samp{\}, when @code{icanon} is set.
-Non-@acronym{POSIX}. May be negated.
+Non-POSIX@. May be negated.
@item tostop
@opindex tostop
@cindex background jobs, stopping at terminal write
-Stop background jobs that try to write to the terminal. Non-@acronym{POSIX}.
+Stop background jobs that try to write to the terminal. Non-POSIX@.
May be negated.
@item echoprt
@@ -13409,7 +13890,7 @@ May be negated.
@opindex echoprt
@opindex prterase
Echo erased characters backward, between @samp{\} and @samp{/}.
-Non-@acronym{POSIX}. May be negated.
+Non-POSIX@. May be negated.
@item echoctl
@itemx ctlecho
@@ -13418,7 +13899,7 @@ Non-@acronym{POSIX}. May be negated.
@cindex control characters, using @samp{^@var{c}}
@cindex hat notation for control characters
Echo control characters in hat notation (@samp{^@var{c}}) instead
-of literally. Non-@acronym{POSIX}. May be negated.
+of literally. Non-POSIX@. May be negated.
@item echoke
@itemx crtkill
@@ -13427,7 +13908,7 @@ of literally. Non-@acronym{POSIX}. May be negated.
Echo the @code{kill} special character by erasing each character on
the line as indicated by the @code{echoprt} and @code{echoe} settings,
instead of by the @code{echoctl} and @code{echok} settings.
-Non-@acronym{POSIX}.
+Non-POSIX@.
May be negated.
@end table
@@ -13515,18 +13996,18 @@ If negated, same as @code{parenb istrip opost cs7}.
@item decctlq
@opindex decctlq
-Same as @option{-ixany}. Non-@acronym{POSIX}. May be negated.
+Same as @option{-ixany}. Non-POSIX@. May be negated.
@item tabs
@opindex tabs
-Same as @code{tab0}. Non-@acronym{POSIX}. May be negated. If negated, same
+Same as @code{tab0}. Non-POSIX@. May be negated. If negated, same
as @code{tab3}.
@item lcase
@itemx LCASE
@opindex lcase
@opindex LCASE
-Same as @code{xcase iuclc olcuc}. Non-@acronym{POSIX}. May be negated.
+Same as @code{xcase iuclc olcuc}. Non-POSIX@. May be negated.
(Used for terminals with uppercase characters only.)
@item crt
@@ -13588,11 +14069,11 @@ End the line.
@item eol2
@opindex eol2
-Alternate character to end the line. Non-@acronym{POSIX}.
+Alternate character to end the line. Non-POSIX.
@item swtch
@opindex swtch
-Switch to a different shell layer. Non-@acronym{POSIX}.
+Switch to a different shell layer. Non-POSIX.
@item start
@opindex start
@@ -13608,20 +14089,20 @@ Send a terminal stop signal.
@item dsusp
@opindex dsusp
-Send a terminal stop signal after flushing the input. Non-@acronym{POSIX}.
+Send a terminal stop signal after flushing the input. Non-POSIX.
@item rprnt
@opindex rprnt
-Redraw the current line. Non-@acronym{POSIX}.
+Redraw the current line. Non-POSIX.
@item werase
@opindex werase
-Erase the last word typed. Non-@acronym{POSIX}.
+Erase the last word typed. Non-POSIX.
@item lnext
@opindex lnext
Enter the next character typed literally, even if it is a special
-character. Non-@acronym{POSIX}.
+character. Non-POSIX.
@end table
@@ -13652,13 +14133,13 @@ Set the output speed to @var{n}.
@item rows @var{n}
@opindex rows
Tell the tty kernel driver that the terminal has @var{n} rows.
-Non-@acronym{POSIX}.
+Non-POSIX.
@item cols @var{n}
@itemx columns @var{n}
@opindex cols
@opindex columns
-Tell the kernel that the terminal has @var{n} columns. Non-@acronym{POSIX}.
+Tell the kernel that the terminal has @var{n} columns. Non-POSIX.
@item size
@opindex size
@@ -13668,11 +14149,11 @@ Print the number of rows and columns that the kernel thinks the
terminal has. (Systems that don't support rows and columns in the kernel
typically use the environment variables @env{LINES} and @env{COLUMNS}
instead; however, GNU @command{stty} does not know anything about them.)
-Non-@acronym{POSIX}.
+Non-POSIX.
@item line @var{n}
@opindex line
-Use line discipline @var{n}. Non-@acronym{POSIX}.
+Use line discipline @var{n}. Non-POSIX.
@item speed
@opindex speed
@@ -13853,7 +14334,7 @@ Print the user or group name instead of the ID number. Requires
@itemx --real
@opindex -r
@opindex --real
-Print the real, instead of effective, user or group ID. Requires
+Print the real, instead of effective, user or group ID@. Requires
@option{-u}, @option{-g}, or @option{-G}.
@item -u
@@ -13915,7 +14396,7 @@ options}.
@cindex printing the effective user ID
@command{whoami} prints the user name associated with the current
-effective user ID. It is equivalent to the command @samp{id -un}.
+effective user ID@. It is equivalent to the command @samp{id -un}.
The only options are @option{--help} and @option{--version}. @xref{Common
options}.
@@ -14059,7 +14540,7 @@ Print a line of column headings.
List only the entries that correspond to processes via which the
system is waiting for a user to login. The user name is always @samp{LOGIN}.
-@itemx --lookup
+@item --lookup
@opindex --lookup
Attempt to canonicalize hostnames found in utmp through a DNS lookup. This
is not the default because it can cause significant delays on systems with
@@ -14098,7 +14579,7 @@ Ignored; for compatibility with other versions of @command{who}.
@opindex --time
Print last system clock change.
-@itemx -u
+@item -u
@opindex -u
@cindex idle time
After the login time, print the number of hours and minutes that the
@@ -14217,23 +14698,23 @@ hour (@samp{00}@dots{}@samp{23})
@item %I
hour (@samp{01}@dots{}@samp{12})
@item %k
-hour, space padded (@samp{ 0}@dots{}@samp{23}); equivalent to @samp{%_H}.
-This is a @acronym{GNU} extension.
+hour, space padded (@samp{ 0}@dots{}@samp{23}); equivalent to @samp{%_H}@.
+This is a GNU extension.
@item %l
-hour, space padded (@samp{ 1}@dots{}@samp{12}); equivalent to @samp{%_I}.
-This is a @acronym{GNU} extension.
+hour, space padded (@samp{ 1}@dots{}@samp{12}); equivalent to @samp{%_I}@.
+This is a GNU extension.
@item %M
minute (@samp{00}@dots{}@samp{59})
@item %N
nanoseconds (@samp{000000000}@dots{}@samp{999999999}).
-This is a @acronym{GNU} extension.
+This is a GNU extension.
@item %p
locale's equivalent of either @samp{AM} or @samp{PM};
blank in many locales.
Noon is treated as @samp{PM} and midnight as @samp{AM}.
@item %P
like @samp{%p}, except lower case.
-This is a @acronym{GNU} extension.
+This is a GNU extension.
@item %r
locale's 12-hour clock time (e.g., @samp{11:11:04 PM})
@item %R
@@ -14242,11 +14723,13 @@ locale's 12-hour clock time (e.g., @samp{11:11:04 PM})
@cindex epoch, seconds since
@cindex seconds since the epoch
@cindex beginning of time
-seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC.
+@cindex leap seconds
+seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC@.
Leap seconds are not counted unless leap second support is available.
@xref{%s-examples}, for examples.
-This is a @acronym{GNU} extension.
+This is a GNU extension.
@item %S
+@cindex leap seconds
second (@samp{00}@dots{}@samp{60}).
This may be @samp{60} if leap seconds are supported.
@item %T
@@ -14254,7 +14737,7 @@ This may be @samp{60} if leap seconds are supported.
@item %X
locale's time representation (e.g., @samp{23:13:48})
@item %z
-@w{@acronym{RFC} 2822/@acronym{ISO} 8601} style numeric time zone
+@w{RFC 2822/ISO 8601} style numeric time zone
(e.g., @samp{-0600} or @samp{+0530}), or nothing if no
time zone is determinable. This value reflects the numeric time zone
appropriate for the current time, using the time zone rules specified
@@ -14262,20 +14745,20 @@ by the @env{TZ} environment variable.
The time (and optionally, the time zone rules) can be overridden
by the @option{--date} option.
@item %:z
-@w{@acronym{RFC} 3339/@acronym{ISO} 8601} style numeric time zone with
+@w{RFC 3339/ISO 8601} style numeric time zone with
@samp{:} (e.g., @samp{-06:00} or @samp{+05:30}), or nothing if no time
zone is determinable.
-This is a @acronym{GNU} extension.
+This is a GNU extension.
@item %::z
Numeric time zone to the nearest second with @samp{:} (e.g.,
@samp{-06:00:00} or @samp{+05:30:00}), or nothing if no time zone is
determinable.
-This is a @acronym{GNU} extension.
+This is a GNU extension.
@item %:::z
Numeric time zone with @samp{:} using the minimum necessary precision
(e.g., @samp{-06}, @samp{+05:30}, or @samp{-04:56:02}), or nothing if
no time zone is determinable.
-This is a @acronym{GNU} extension.
+This is a GNU extension.
@item %Z
alphabetic time zone abbreviation (e.g., @samp{EDT}), or nothing if no
time zone is determinable. See @samp{%z} for how it is determined.
@@ -14313,19 +14796,19 @@ date; same as @samp{%m/%d/%y}
@item %e
day of month, space padded; same as @samp{%_d}
@item %F
-full date in @acronym{ISO} 8601 format; same as @samp{%Y-%m-%d}.
+full date in ISO 8601 format; same as @samp{%Y-%m-%d}.
This is a good choice for a date format, as it is standard and
is easy to sort in the usual case where years are in the range
0000@dots{}9999.
@item %g
-year corresponding to the @acronym{ISO} week number, but without the century
+year corresponding to the ISO week number, but without the century
(range @samp{00} through @samp{99}). This has the same format and value
-as @samp{%y}, except that if the @acronym{ISO} week number (see
+as @samp{%y}, except that if the ISO week number (see
@samp{%V}) belongs
to the previous or next year, that year is used instead.
@item %G
-year corresponding to the @acronym{ISO} week number. This has the
-same format and value as @samp{%Y}, except that if the @acronym{ISO}
+year corresponding to the ISO week number. This has the
+same format and value as @samp{%Y}, except that if the ISO
week number (see
@samp{%V}) belongs to the previous or next year, that year is used
instead.
@@ -14345,12 +14828,12 @@ week number of year, with Sunday as the first day of the week
(@samp{00}@dots{}@samp{53}).
Days in a new year preceding the first Sunday are in week zero.
@item %V
-@acronym{ISO} week number, that is, the
+ISO week number, that is, the
week number of year, with Monday as the first day of the week
(@samp{01}@dots{}@samp{53}).
If the week containing January 1 has four or more days in
the new year, then it is considered week 1; otherwise, it is week 53 of
-the previous year, and the next week is week 1. (See the @acronym{ISO} 8601
+the previous year, and the next week is week 1. (See the ISO 8601
standard.)
@item %w
day of week (@samp{0}@dots{}@samp{6}) with 0 corresponding to Sunday
@@ -14400,7 +14883,7 @@ example, numeric months are always output as two digits.
Seconds since the epoch are not padded, though,
since there is no natural width for them.
-As a @acronym{GNU} extension, @command{date} recognizes any of the
+As a GNU extension, @command{date} recognizes any of the
following optional flags after the @samp{%}:
@table @samp
@@ -14432,7 +14915,7 @@ date +%_d/%_m -d "Feb 1"
@result{} 1/ 2
@end example
-As a @acronym{GNU} extension, you can specify the field width
+As a GNU extension, you can specify the field width
(after any flag, if present) as a decimal number. If the natural size of the
output of the field has less than the specified number of characters,
the result is written right adjusted and padded to the given
@@ -14526,8 +15009,8 @@ format. It can contain month names, time zones, @samp{am} and @samp{pm},
@samp{yesterday}, etc. For example, @option{--date="2004-02-27
14:19:13.489392193 +0530"} specifies the instant of time that is
489,392,193 nanoseconds after February 27, 2004 at 2:19:13 PM in a
-time zone that is 5 hours and 30 minutes east of @acronym{UTC}.@*
-Note: input currently must be in locale independent format. E.g., the
+time zone that is 5 hours and 30 minutes east of UTC.@*
+Note: input currently must be in locale independent format. E.g., the
LC_TIME=C below is needed to print back the correct date in many locales:
@example
date -d "$(LC_TIME=C date)"
@@ -14548,7 +15031,7 @@ be considerable.
@itemx --iso-8601[=@var{timespec}]
@opindex -I[@var{timespec}]
@opindex --iso-8601[=@var{timespec}]
-Display the date using the @acronym{ISO} 8601 format, @samp{%Y-%m-%d}.
+Display the date using the ISO 8601 format, @samp{%Y-%m-%d}.
The argument @var{timespec} specifies the number of additional
terms of the time to include. It can be one of the following:
@@ -14595,7 +15078,7 @@ Fri, 09 Sep 2005 13:51:39 -0700
This format conforms to
@uref{ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt, Internet
-@acronym{RFCs} 2822} and
+RFCs 2822} and
@uref{ftp://ftp.rfc-editor.org/in-notes/rfc822.txt, 822}, the
current and previous standards for Internet email.
@@ -14603,10 +15086,10 @@ current and previous standards for Internet email.
@opindex --rfc-3339=@var{timespec}
Display the date using a format specified by
@uref{ftp://ftp.rfc-editor.org/in-notes/rfc3339.txt, Internet
-@acronym{RFC} 3339}. This is a subset of the @acronym{ISO} 8601
+RFC 3339}. This is a subset of the ISO 8601
format, except that it also permits applications to use a space rather
than a @samp{T} to separate dates from times. Unlike the other
-standard formats, @acronym{RFC} 3339 format is always suitable as
+standard formats, RFC 3339 format is always suitable as
input for the @option{--date} (@option{-d}) and @option{--file}
(@option{-f}) options, regardless of the current locale.
@@ -14622,7 +15105,7 @@ This is equivalent to the format @samp{%Y-%m-%d}.
Print the full-date and full-time separated by a space, e.g.,
@samp{2005-09-14 00:56:06+05:30}. The output ends with a numeric
time-offset; here the @samp{+05:30} means that local time is five
-hours and thirty minutes east of @acronym{UTC}. This is equivalent to
+hours and thirty minutes east of UTC@. This is equivalent to
the format @samp{%Y-%m-%d %H:%M:%S%:z}.
@item ns
@@ -14649,12 +15132,15 @@ See also @ref{Setting the time}.
@cindex UTC
@cindex Greenwich Mean Time
@cindex GMT
+@cindex leap seconds
@vindex TZ
-Use Coordinated Universal Time (@acronym{UTC}) by operating as if the
+Use Coordinated Universal Time (UTC) by operating as if the
@env{TZ} environment variable were set to the string @samp{UTC0}.
Coordinated
-Universal Time is often called ``Greenwich Mean Time'' (@sc{gmt}) for
+Universal Time is often called ``Greenwich Mean Time'' (GMT) for
historical reasons.
+Typically, systems ignore leap seconds and thus implement an
+approximation to UTC rather than true UTC.
@end table
@@ -14702,7 +15188,7 @@ for example @samp{date -d 1may '+%B %d'} will print @samp{May 01}.
@item
To print a date without the leading zero for one-digit days
-of the month, you can use the (@acronym{GNU} extension)
+of the month, you can use the (GNU extension)
@samp{-} flag to suppress
the padding altogether:
@@ -14712,7 +15198,7 @@ date -d 1may '+%B %-d
@item
To print the current date and time in the format required by many
-non-@acronym{GNU} versions of @command{date} when setting the system clock:
+non-GNU versions of @command{date} when setting the system clock:
@example
date +%m%d%H%M%Y.%S
@@ -14726,7 +15212,7 @@ date --set='+2 minutes'
@end example
@item
-To print the date in @acronym{RFC} 2822 format,
+To print the date in RFC 2822 format,
use @samp{date --rfc-2822}. Here is some example output:
@example
@@ -14805,6 +15291,36 @@ date -u -d '1970-01-01 946684800 seconds' +"%Y-%m-%d %T %z"
2000-01-01 00:00:00 +0000
@end smallexample
+@item
+@cindex leap seconds
+Typically the seconds count omits leap seconds, but some systems are
+exceptions. Because leap seconds are not predictable, the mapping
+between the seconds count and a future timestamp is not reliable on
+the atypical systems that include leap seconds in their counts.
+
+Here is how the two kinds of systems handle the leap second at
+2012-06-30 23:59:60 UTC:
+
+@example
+# Typical systems ignore leap seconds:
+date --date='2012-06-30 23:59:59 +0000' +%s
+1341100799
+date --date='2012-06-30 23:59:60 +0000' +%s
+date: invalid date '2012-06-30 23:59:60 +0000'
+date --date='2012-07-01 00:00:00 +0000' +%s
+1341100800
+@end example
+
+@example
+# Atypical systems count leap seconds:
+date --date='2012-06-30 23:59:59 +0000' +%s
+1341100823
+date --date='2012-06-30 23:59:60 +0000' +%s
+1341100824
+date --date='2012-07-01 00:00:00 +0000' +%s
+1341100825
+@end example
+
@end itemize
@@ -14973,9 +15489,9 @@ Print the kernel release.
@cindex kernel name
@cindex name of kernel
Print the kernel name.
-@acronym{POSIX} 1003.1-2001 (@pxref{Standards conformance}) calls this
+POSIX 1003.1-2001 (@pxref{Standards conformance}) calls this
``the implementation of the operating system'', because the
-@acronym{POSIX} specification itself has no notion of ``kernel''.
+POSIX specification itself has no notion of ``kernel''.
The kernel name might be the same as the operating system name printed
by the @option{-o} or @option{--operating-system} option, but it might
differ. Some operating systems (e.g., FreeBSD, HP-UX) have the same
@@ -15114,12 +15630,16 @@ The program accepts the following options. Also see @ref{Common options}.
@table @samp
+@item --dereference
+@opindex --dereference
+Do not affect symbolic links but what they refer to; this is the default.
+
@item -h
@itemx --no-dereference
@opindex -h
@opindex --no-dereference
@cindex no dereference
-Affect symbolic links instead of any referenced file.
+Affect the symbolic links themselves instead of any referenced file.
@item --reference=@var{rfile}
@opindex --reference
@@ -15132,6 +15652,18 @@ Use @var{rfile}'s security context rather than specifying a @var{context} value.
@opindex --recursive
Operate on files and directories recursively.
+@item --preserve-root
+@opindex --preserve-root
+Refuse to operate recursively on the root directory, @file{/},
+when used together with the @option{--recursive} option.
+@xref{Treating / specially}.
+
+@item --no-preserve-root
+@opindex --no-preserve-root
+Do not treat the root directory, @file{/}, specially when operating
+recursively; this is the default.
+@xref{Treating / specially}.
+
@choptH
@xref{Traversing symlinks}.
@@ -15266,7 +15798,6 @@ user, etc.
* nice invocation:: Modify niceness.
* nohup invocation:: Immunize to hangups.
* stdbuf invocation:: Modify buffering of standard streams.
-* su invocation:: Modify user and group ID.
* timeout invocation:: Run with time limit.
@end menu
@@ -15305,14 +15836,14 @@ Options must precede operands.
@table @samp
-@itemx --userspec=@var{user}[:@var{group}]
+@item --userspec=@var{user}[:@var{group}]
@opindex --userspec
By default, @var{command} is run with the same credentials
as the invoking process.
Use this option to run it as a different @var{user} and/or with a
different primary @var{group}.
-@itemx --groups=@var{groups}
+@item --groups=@var{groups}
@opindex --groups
Use this option to specify the supplementary @var{groups} to be
used by the new process.
@@ -15383,9 +15914,9 @@ These operands are evaluated left-to-right, so if two operands
mention the same variable the earlier is ignored.
Environment variable names can be empty, and can contain any
-characters other than @samp{=} and @acronym{ASCII} @sc{nul}.
+characters other than @samp{=} and ASCII NUL.
However, it is wise to limit yourself to names that
-consist solely of underscores, digits, and @acronym{ASCII} letters,
+consist solely of underscores, digits, and ASCII letters,
and that begin with a non-digit, as applications like the shell do not
work well with other names.
@@ -15517,8 +16048,9 @@ the exit status of @var{command} otherwise
@cindex scheduling, affecting
@cindex appropriate privileges
-@command{nice} prints or modifies a process's @dfn{niceness},
-a parameter that affects whether the process is scheduled favorably.
+@command{nice} prints a process's @dfn{niceness}, or runs
+a command with modified niceness. @dfn{niceness} affects how
+favorably the process is scheduled in the system.
Synopsis:
@example
@@ -15533,7 +16065,7 @@ Niceness values range at least from @minus{}20 (process has high priority
and gets more resources, thus slowing down other processes) through 19
(process has lower priority and runs slowly itself, but has less impact
on the speed of other running processes). Some systems
-may have a wider range of nicenesses; conversely, other systems may
+may have a wider range of niceness values; conversely, other systems may
enforce more restrictive limits. An attempt to set the niceness
outside the supported range is treated as an attempt to use the
minimum or maximum supported value.
@@ -15542,10 +16074,10 @@ A niceness should not be confused with a scheduling priority, which
lets applications determine the order in which threads are scheduled
to run. Unlike a priority, a niceness is merely advice to the
scheduler, which the scheduler is free to ignore. Also, as a point of
-terminology, @acronym{POSIX} defines the behavior of @command{nice} in
+terminology, POSIX defines the behavior of @command{nice} in
terms of a @dfn{nice value}, which is the nonnegative difference
between a niceness and the minimum niceness. Though @command{nice}
-conforms to @acronym{POSIX}, its documentation and diagnostics use the
+conforms to POSIX, its documentation and diagnostics use the
term ``niceness'' for compatibility with historical practice.
@var{command} must not be a special built-in utility (@pxref{Special
@@ -15553,6 +16085,9 @@ built-in utilities}).
@mayConflictWithShellBuiltIn{nice}
+Note to change the @dfn{niceness} of an existing process,
+one needs to use the @command{renice} command.
+
The program accepts the following option. Also see @ref{Common options}.
Options must precede operands.
@@ -15651,8 +16186,8 @@ nohup @var{command} [@var{arg}]@dots{}
If standard input is a terminal, it is redirected from
@file{/dev/null} so that terminal sessions do not mistakenly consider
-the terminal to be used by the command. This is a @acronym{GNU}
-extension; programs intended to be portable to non-@acronym{GNU} hosts
+the terminal to be used by the command. This is a GNU
+extension; programs intended to be portable to non-GNU hosts
should use @samp{nohup @var{command} [@var{arg}]@dots{} </dev/null}
instead.
@@ -15794,163 +16329,6 @@ the exit status of @var{command} otherwise
@end display
-@node su invocation
-@section @command{su}: Run a command with substitute user and group ID
-
-@pindex su
-@cindex substitute user and group IDs
-@cindex user ID, switching
-@cindex super-user, becoming
-@cindex root, becoming
-
-@command{su} allows one user to temporarily become another user. It runs a
-command (often an interactive shell) with the real and effective user
-ID, group ID, and supplemental groups of a given @var{user}. Synopsis:
-
-@example
-su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
-@end example
-
-@cindex passwd entry, and @command{su} shell
-@flindex /bin/sh
-@flindex /etc/passwd
-If no @var{user} is given, the default is @code{root}, the super-user.
-The shell to use is taken from @var{user}'s @code{passwd} entry, or
-@file{/bin/sh} if none is specified there. If @var{user} has a
-password, @command{su} prompts for the password unless run by a user with
-effective user ID of zero (the super-user).
-
-@vindex HOME
-@vindex SHELL
-@vindex USER
-@vindex LOGNAME
-@cindex login shell
-By default, @command{su} does not change the current directory.
-It sets the environment variables @env{HOME} and @env{SHELL}
-from the password entry for @var{user}, and if @var{user} is not
-the super-user, sets @env{USER} and @env{LOGNAME} to @var{user}.
-By default, the shell is not a login shell.
-
-Any additional @var{arg}s are passed as additional arguments to the
-shell.
-
-@cindex @option{-su}
-GNU @command{su} does not treat @file{/bin/sh} or any other shells specially
-(e.g., by setting @code{argv[0]} to @option{-su}, passing @option{-c} only
-to certain shells, etc.).
-
-@findex syslog
-@command{su} can optionally be compiled to use @code{syslog} to report
-failed, and optionally successful, @command{su} attempts. (If the system
-supports @code{syslog}.) However, GNU @command{su} does not check if the
-user is a member of the @code{wheel} group; see below.
-
-The program accepts the following options. Also see @ref{Common options}.
-
-@table @samp
-@item -c @var{command}
-@itemx --command=@var{command}
-@opindex -c
-@opindex --command
-Pass @var{command}, a single command line to run, to the shell with
-a @option{-c} option instead of starting an interactive shell.
-
-@item -f
-@itemx --fast
-@opindex -f
-@opindex --fast
-@flindex .cshrc
-@cindex file name pattern expansion, disabled
-@cindex globbing, disabled
-Pass the @option{-f} option to the shell. This probably only makes sense
-if the shell run is @command{csh} or @command{tcsh}, for which the @option{-f}
-option prevents reading the startup file (@file{.cshrc}). With
-Bourne-like shells, the @option{-f} option disables file name pattern
-expansion (globbing), which is not likely to be useful.
-
-@item -
-@itemx -l
-@itemx --login
-@opindex -
-@opindex -l
-@opindex --login
-@c other variables already indexed above
-@vindex TERM
-@vindex PATH
-@cindex login shell, creating
-Make the shell a login shell. This means the following. Unset all
-environment variables except @env{TERM}, @env{HOME}, and @env{SHELL}
-(which are set as described above), and @env{USER} and @env{LOGNAME}
-(which are set, even for the super-user, as described above), and set
-@env{PATH} to a compiled-in default value. Change to @var{user}'s home
-directory. Prepend @samp{-} to the shell's name, intended to make it
-read its login startup file(s).
-
-@item -m
-@itemx -p
-@itemx --preserve-environment
-@opindex -m
-@opindex -p
-@opindex --preserve-environment
-@cindex environment, preserving
-@flindex /etc/shells
-@cindex restricted shell
-Do not change the environment variables @env{HOME}, @env{USER},
-@env{LOGNAME}, or @env{SHELL}. Run the shell given in the environment
-variable @env{SHELL} instead of the shell from @var{user}'s passwd
-entry, unless the user running @command{su} is not the super-user and
-@var{user}'s shell is restricted. A @dfn{restricted shell} is one that
-is not listed in the file @file{/etc/shells}, or in a compiled-in list
-if that file does not exist. Parts of what this option does can be
-overridden by @option{--login} and @option{--shell}.
-
-@item -s @var{shell}
-@itemx --shell=@var{shell}
-@opindex -s
-@opindex --shell
-Run @var{shell} instead of the shell from @var{user}'s passwd entry,
-unless the user running @command{su} is not the super-user and @var{user}'s
-shell is restricted (see @option{-m} just above).
-
-@end table
-
-@cindex exit status of @command{su}
-Exit status:
-
-@display
-125 if @command{su} itself fails
-126 if subshell is found but cannot be invoked
-127 if subshell cannot be found
-the exit status of the subshell otherwise
-@end display
-
-@cindex wheel group, not supported
-@cindex group wheel, not supported
-@cindex fascism
-@subsection Why GNU @command{su} does not support the @samp{wheel} group
-
-(This section is by Richard Stallman.)
-
-@cindex Twenex
-@cindex MIT AI lab
-Sometimes a few of the users try to hold total power over all the
-rest. For example, in 1984, a few users at the MIT AI lab decided to
-seize power by changing the operator password on the Twenex system and
-keeping it secret from everyone else. (I was able to thwart this coup
-and give power back to the users by patching the kernel, but I
-wouldn't know how to do that in Unix.)
-
-However, occasionally the rulers do tell someone. Under the usual
-@command{su} mechanism, once someone learns the root password who
-sympathizes with the ordinary users, he or she can tell the rest. The
-``wheel group'' feature would make this impossible, and thus cement the
-power of the rulers.
-
-I'm on the side of the masses, not that of the rulers. If you are
-used to supporting the bosses and sysadmins in whatever they do, you
-might find this idea strange at first.
-
-
@node timeout invocation
@section @command{timeout}: Run a command with a time limit
@@ -15972,7 +16350,13 @@ The program accepts the following options. Also see @ref{Common options}.
Options must precede operands.
@table @samp
-@itemx --foreground
+@item --preserve-status
+@opindex --preserve-status
+Return the exit status of the managed @var{command} on timeout, rather than
+a specific exit status indicating a timeout. This is useful if the
+managed @var{command} supports running for an indeterminite amount of time.
+
+@item --foreground
@opindex --foreground
Don't create a separate background program group, so that
the managed @var{command} can use the foreground TTY normally.
@@ -16003,8 +16387,8 @@ the @var{command}.
@opindex -s
@opindex --signal
Send this @var{signal} to @var{command} on timeout, rather than the
-default @samp{TERM} signal. @var{signal} may be a name like @samp{HUP}
-or a number. @xref{Signal specifications}.
+default @samp{TERM} signal. @var{signal} may be a name like @samp{HUP}
+or a number. @xref{Signal specifications}.
@end table
@cindex time units
@@ -16062,7 +16446,7 @@ kill [-l | --list | -t | --table] [@var{signal}]@dots{}
The first form of the @command{kill} command sends a signal to all
@var{pid} arguments. The default signal to send if none is specified
-is @samp{TERM}. The special signal number @samp{0} does not denote a
+is @samp{TERM}@. The special signal number @samp{0} does not denote a
valid signal, but can be used to test whether the @var{pid} arguments
specify processes to which a signal could be sent.
@@ -16080,7 +16464,7 @@ is sent.
If a negative @var{pid} argument is desired as the first one, it
should be preceded by @option{--}. However, as a common extension to
-@acronym{POSIX}, @option{--} is not required with @samp{kill
+POSIX, @option{--} is not required with @samp{kill
-@var{signal} -@var{pid}}. The following commands are equivalent:
@example
@@ -16110,7 +16494,7 @@ The @command{kill} command also supports the @option{--help} and
A @var{signal} may be a signal name like @samp{HUP}, or a signal
number like @samp{1}, or an exit status of a process terminated by the
signal. A signal name can be given in canonical form or prefixed by
-@samp{SIG}. The case of the letters is ignored, except for the
+@samp{SIG}@. The case of the letters is ignored, except for the
@option{-@var{signal}} option which must use upper case to avoid
ambiguity with lower case option letters.
@xref{Signal specifications}, for a list of supported
@@ -16277,7 +16661,7 @@ Options must precede operands.
Print all numbers using @var{format}.
@var{format} must contain exactly one of the @samp{printf}-style
floating point conversion specifications @samp{%a}, @samp{%e},
-@samp{%f}, @samp{%g}, @samp{%A}, @samp{%E}, @samp{%F}, @samp{%G}.
+@samp{%f}, @samp{%g}, @samp{%A}, @samp{%E}, @samp{%F}, @samp{%G}@.
The @samp{%} may be followed by zero or more flags taken from the set
@samp{-+#0 '}, then an optional width containing one or more digits,
then an optional precision consisting of a @samp{.} followed by zero
@@ -16346,12 +16730,16 @@ case is that @command{seq} works with integers through @math{2^{64}},
and larger integers may not be numerically correct:
@example
-$ seq 18446744073709551616 1 18446744073709551618
-18446744073709551616
-18446744073709551616
-18446744073709551618
+$ seq 50000000000000000000 2 50000000000000000004
+50000000000000000000
+50000000000000000000
+50000000000000000004
@end example
+However, note that when limited to non-negative whole numbers,
+an increment of 1 and no format-specifying option, seq can print
+arbitrarily large numbers.
+
Be careful when using @command{seq} with outlandish values: otherwise
you may see surprising results, as @command{seq} uses floating point
internally. For example, on the x86 platform, where the internal
@@ -16379,7 +16767,7 @@ outputs 1.0000000000000000007 twice and skips 1.0000000000000000008.
An earlier version of this chapter appeared in
@uref{http://www.linuxjournal.com/article.php?sid=2762, the
-@cite{What's GNU?} column of the June 1994 @cite{Linux Journal}}.
+@cite{What's GNU@?} column of the June 1994 @cite{Linux Journal}}.
It was written by Arnold Robbins.
@menu
@@ -16489,7 +16877,7 @@ redirected standard output of your program away from your screen.
For filter programs to work together, the format of the data has to be
agreed upon. The most straightforward and easiest format to use is simply
lines of text. Unix data files are generally just streams of bytes, with
-lines delimited by the @acronym{ASCII} @sc{lf} (Line Feed) character,
+lines delimited by the ASCII LF (Line Feed) character,
conventionally called a ``newline'' in the Unix literature. (This is
@code{'\n'} if you're a C programmer.) This is the format used by all
the traditional filtering programs. (Many earlier operating systems
@@ -16757,7 +17145,7 @@ $ tr '[:upper:]' '[:lower:]' < whats.gnu | tr -cd '[:alnum:]_ \n' | ...
The second @command{tr} command operates on the complement of the listed
characters, which are all the letters, the digits, the underscore, and
the blank. The @samp{\n} represents the newline character; it has to
-be left alone. (The @acronym{ASCII} tab character should also be included for
+be left alone. (The ASCII tab character should also be included for
good measure in a production script.)
At this point, we have data consisting of words separated by blank space.