update reproducible builds patch
[debian/gzip] / doc / gzip.texi
index ecd4e00b74e6a5f74ca8bc1134671dd68a193d57..1d8d100fa81547eb0c3a60a5931ea1e0960db429 100644 (file)
@@ -1,6 +1,7 @@
 \input texinfo @c -*-texinfo-*-
 @c %**start of header
 @setfilename gzip.info
+@documentencoding UTF-8
 @include version.texi
 @settitle GNU Gzip
 @finalout
@@ -11,7 +12,7 @@ This manual is for GNU Gzip
 (version @value{VERSION}, @value{UPDATED}),
 and documents commands for compressing and decompressing data.
 
-Copyright @copyright{} 1998-1999, 2001-2002, 2006-2007, 2009-2010 Free Software
+Copyright @copyright{} 1998-1999, 2001-2002, 2006-2007, 2009-2016 Free Software
 Foundation, Inc.
 
 Copyright @copyright{} 1992, 1993 Jean-loup Gailly
@@ -79,13 +80,13 @@ Free Documentation License''.
 @chapter Overview
 @cindex overview
 
-@command{gzip} reduces the size of the named files using Lempel-Ziv coding
+@command{gzip} reduces the size of the named files using Lempel--Ziv coding
 (LZ77).  Whenever possible, each file is replaced by one with the
 extension @samp{.gz}, while keeping the same ownership modes, access and
 modification times.  (The default extension is @samp{-gz} for @abbr{VMS},
 @samp{z} for @abbr{MSDOS}, @abbr{OS/2} @abbr{FAT} and Atari.)
 If no files are specified or
-if a file name is "-", the standard input is compressed to the standard
+if a file name is @file{-}, the standard input is compressed to the standard
 output.  @command{gzip} will only attempt to compress regular files.  In
 particular, it will ignore symbolic links.
 
@@ -140,7 +141,7 @@ its input, and happily generates garbage output.  The @abbr{SCO} @samp{compress
 also allows some consistency checks.
 
 Files created by @command{zip} can be uncompressed by @command{gzip} only if
-they have a single member compressed with the 'deflation' method.  This
+they have a single member compressed with the ``deflation'' method.  This
 feature is only intended to help conversion of @file{tar.zip} files to
 the @file{tar.gz} format.  To extract a @command{zip} file with a single
 member, use a command like @samp{gunzip <foo.zip} or @samp{gunzip -S
@@ -153,11 +154,11 @@ input and writes the uncompressed data on standard output.  @command{zcat}
 will uncompress files that have the correct magic number whether they
 have a @samp{.gz} suffix or not.
 
-@command{gzip} uses the Lempel-Ziv algorithm used in @command{zip} and
+@command{gzip} uses the Lempel--Ziv algorithm used in @command{zip} and
 @abbr{PKZIP}@.
 The amount of compression obtained depends on the size of the input and
 the distribution of common substrings.  Typically, text such as source
-code or English is reduced by 60-70%.  Compression is generally much
+code or English is reduced by 60--70%.  Compression is generally much
 better than that achieved by @abbr{LZW} (as used in @command{compress}), Huffman
 coding (as used in @command{pack}), or adaptive Huffman coding
 (@command{compact}).
@@ -169,12 +170,12 @@ ratio of 0.015% for large files.  Note that the actual number of used
 disk blocks almost never increases.  @command{gzip} normally preserves the mode,
 ownership and time stamps of files when compressing or decompressing.
 
-The @command{gzip} file format is specified in P. Deutsch, @sc{gzip} file
+The @command{gzip} file format is specified in P. Deutsch, GZIP file
 format specification version 4.3,
-@uref{ftp://ftp.isi.edu/in-notes/rfc1952.txt, Internet @abbr{RFC} 1952} (May
+@uref{http://www.ietf.org/rfc/rfc1952.txt, Internet @abbr{RFC} 1952} (May
 1996).  The @command{zip} deflation format is specified in P. Deutsch,
-@sc{deflate} Compressed Data Format Specification version 1.3,
-@uref{ftp://ftp.isi.edu/in-notes/rfc1951.txt, Internet @abbr{RFC} 1951} (May
+DEFLATE Compressed Data Format Specification version 1.3,
+@uref{http://www.ietf.org/rfc/rfc1951.txt, Internet @abbr{RFC} 1951} (May
 1996).
 
 @node Sample
@@ -195,19 +196,21 @@ Mandatory arguments to long options are mandatory for short options too.
   -d, --decompress  decompress
   -f, --force       force overwrite of output file and compress links
   -h, --help        give this help
+  -k, --keep        keep (don't delete) input files
   -l, --list        list compressed file contents
   -L, --license     display software license
   -n, --no-name     do not save or restore the original name and time stamp
   -N, --name        save or restore the original name and time stamp
   -q, --quiet       suppress all warnings
   -r, --recursive   operate recursively on directories
+      --rsyncable   make rsync-friendly archive
   -S, --suffix=SUF  use suffix SUF on compressed files
+      --synchronous synchronous output (safer if system crashes, but slower)
   -t, --test        test compressed file integrity
   -v, --verbose     verbose mode
   -V, --version     display version number
   -1, --fast        compress faster
   -9, --best        compress better
-    --rsyncable   Make rsync-friendly archive
 
 With no FILE, or when FILE is -, read standard input.
 
@@ -229,7 +232,7 @@ stopping on the first failure:
 find . -name '*
 *' -prune -o -name '*.gz' -type f -print |
   sed "
-    s/'/'\\''/g
+    s/'/'\\\\''/g
     s/^\\(.*\\)\\.gz$/gunzip <'\\1.gz' >'\\1'/
   " |
   sh -e
@@ -277,6 +280,10 @@ whether an existing file should be overwritten.
 @itemx -h
 Print an informative help message describing the options then quit.
 
+@item --keep
+@itemx -k
+Keep (don't delete) input files during compression or decompression.
+
 @item --list
 @itemx -l
 For each compressed file, list the following fields:
@@ -355,20 +362,11 @@ into the directory and compress all the files it finds there (or
 decompress them in the case of @command{gunzip}).
 
 @item --rsyncable
-While compressing, synchronize the output occasionally based on the
-input.  This can reduce the compression slightly in some cases, but
-means that the @code{rsync} program can take advantage of similarities
-in the uncompressed input when syncronizing two files compressed with
-this flag.  @code{gunzip} cannot tell the difference between a
-compressed file created with this option, and one created without it.
-
-@item --rsyncable
-While compressing, synchronize the output occasionally based on
-the input.  This increases size by less than 1 percent most
-cases, but means that the @command{rsync} program can much more efficiently
-synchronize files compressed with this flag.  @command{gunzip}
-cannot tell the difference between a compressed file created
-with this option, and one created without it.
+Cater better to the @command{rsync} program by periodically resetting
+the internal structure of the compressed data stream.  This lets the
+@code{rsync} program take advantage of similarities in the uncompressed
+input when synchronizing two files compressed with this flag.  The cost:
+the compressed output is usually about one percent larger.
 
 @item --suffix @var{suf}
 @itemx -S @var{suf}
@@ -385,6 +383,16 @@ gunzip -S "" *        (*.* for MSDOS)
 Previous versions of gzip used the @samp{.z} suffix.  This was changed to
 avoid a conflict with @command{pack}.
 
+@item --synchronous
+Use synchronous output, by transferring output data to the output
+file's storage device when the file system supports this.  Because
+file system data can be cached, without this option if the system
+crashes around the time a command like @samp{gzip FOO} is run the user
+might lose both @file{FOO} and @file{FOO.gz}; this is the default with
+@command{gzip}, just as it is the default with most applications that
+move data.  When this option is used, @command{gzip} is safer but can
+be considerably slower.
+
 @item --test
 @itemx -t
 Test.  Check the compressed file integrity.
@@ -480,18 +488,28 @@ complement to @command{tar}, not as a replacement.
 @chapter Environment
 @cindex Environment
 
-The environment variable @env{GZIP} can hold a set of default options for
-@command{gzip}.  These options are interpreted first and can be overwritten by
-explicit command line parameters.  For example:
+The obsolescent environment variable @env{GZIP} can hold a set of
+default options for @command{gzip}.  These options are interpreted
+first and can be overwritten by explicit command line parameters.  As
+this can cause problems when using scripts, this feature is supported
+only for options that are reasonably likely to not cause too much
+harm, and @command{gzip} warns if it is used.  This feature will be
+removed in a future release of @command{gzip}.
+
+You can use an alias or script instead.  For example, if
+@command{gzip} is in the directory @samp{/usr/bin} you can prepend
+@file{$HOME/bin} to your @env{PATH} and create an executable script
+@file{$HOME/bin/gzip} containing the following:
 
 @example
-for sh:    GZIP="-8v --name"; export GZIP
-for csh:   setenv GZIP "-8v --name"
-for MSDOS: set GZIP=-8v --name
+#! /bin/sh
+export PATH=/usr/bin
+exec gzip -9 "$@@"
 @end example
 
-On @abbr{VMS}, the name of the environment variable is @env{GZIP_OPT}, to
-avoid a conflict with the symbol set for invocation of the program.
+On @abbr{VMS}, the name of the obsolescent environment variable is
+@env{GZIP_OPT}, to avoid a conflict with the symbol set for invocation
+of the program.
 
 @node Tapes
 @chapter Using @command{gzip} on tapes
@@ -502,21 +520,8 @@ the output with zeroes up to a block boundary.  When the data is read and
 the whole block is passed to @command{gunzip} for decompression,
 @command{gunzip} detects that there is extra trailing garbage after the
 compressed data and emits a warning by default if the garbage contains
-nonzero bytes.  You have to use the
-@option{--quiet} option to suppress the warning.  This option can be set in the
-@env{GZIP} environment variable, as in:
-
-@example
-for sh:    GZIP="-q"  tar -xfz --block-compress /dev/rst0
-for csh:   (setenv GZIP "-q"; tar -xfz --block-compress /dev/rst0)
-@end example
-
-In the above example, @command{gzip} is invoked implicitly by the @option{-z}
-option of @acronym{GNU} @command{tar}.  Make sure that the same block
-size (@option{-b}
-option of @command{tar}) is used for reading and writing compressed data on
-tapes.  (This example assumes you are using the @acronym{GNU} version of
-@command{tar}.)
+nonzero bytes.  You can use the @option{--quiet} option to suppress
+the warning.
 
 @node Problems
 @chapter Reporting Bugs