\input texinfo
@c %**start of header
@setfilename coreutils.info
-@settitle @sc{gnu} Coreutils
+@settitle GNU Coreutils
@c %**end of header
* 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.
@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
@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.
* 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
* 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
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
@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
@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.
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
* 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
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
@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
@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.
@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}.
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
@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
@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
@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}.
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.
@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
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 \
@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.
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
@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
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
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
@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.
@item -u
@opindex -u
-Ignored; for @acronym{POSIX} compatibility.
+Ignored; for POSIX compatibility.
@item -v
@itemx --show-nonprinting
@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}
@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
@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}
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
@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
@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
@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
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
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
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}.
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.
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}
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}]
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}
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
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
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}.
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}).
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
@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
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
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
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
@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.
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
@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.
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
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}
@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.
@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.
@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
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.
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.
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
@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
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,
@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.
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.
@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
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
@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
@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
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.
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
@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.
@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.
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}
@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
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}.
@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
@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.
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
@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
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.
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
@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
@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,
@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.
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.
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
@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]+}.
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
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
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}
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.
@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.
@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{}.
@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
@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
@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
@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.
@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
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:
@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
(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}
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}
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
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.
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.
@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
@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
@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:
@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}.}
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:
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.
@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
@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
@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:
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}]
@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.
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
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:
@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
@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
@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.
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
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.
@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 --preserve=all -- "$i" "$i" || fail=1
@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
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
@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
@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
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
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
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
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}]
@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.
@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
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
@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{]}.
@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.
@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.
@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
@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
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
@end table
@cindex multipliers after numbers
-The numeric-valued strings above (@var{n}, @var{bytes} and @var{blocks})
+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}).
@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.
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}.
@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
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:
@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
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{/},
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.
@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:
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:
@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
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
@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}
@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
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
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
@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.
@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
@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.
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
@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
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
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.
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.
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.
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}.
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.
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
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
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
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
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
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
@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.
@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
@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,
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
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
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
(@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
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
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
@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
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}
@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
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}
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
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.
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
@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{}
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
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
@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),
@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'
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
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
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"}}).
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}.
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
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
@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},
@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.
@itemx --zero
@opindex -z
@opindex --zero
-Separate output items with @sc{nul} characters.
+Separate output items with NUL characters.
@end table
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
@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.
@itemx --zero
@opindex -z
@opindex --zero
-Separate output items with @sc{nul} characters.
+Separate output items with NUL characters.
@end table
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
@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
@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,
@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.
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.
@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.
@end table
@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
@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
@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
@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
@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
@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
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
@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
@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
@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
@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
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
@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
@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}.
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
@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
@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
@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
@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
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.
@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.
(@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
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
@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
@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)"
@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:
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.
@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.
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
@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
@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:
@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
@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
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
@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
@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
@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}.
@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.
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.
@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
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.
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
@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.
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.
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.
@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
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.
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
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
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
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
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
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
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.