<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iTechLog &#187; GZIP</title>
	<atom:link href="http://itechlog.com/tag/gzip/feed/" rel="self" type="application/rss+xml" />
	<link>http://itechlog.com</link>
	<description>Your source to IT solutions, interesting technology news and code snipets.</description>
	<lastBuildDate>Tue, 10 Jan 2012 17:06:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>GZIP</title>
		<link>http://itechlog.com/linux-man-pages/2009/01/01/gzip/</link>
		<comments>http://itechlog.com/linux-man-pages/2009/01/01/gzip/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 17:14:00 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[Linux Man Pages]]></category>
		<category><![CDATA[GZIP]]></category>

		<guid isPermaLink="false">http://itechlog.com/linux-man-pages/2009/01/01/gzip/</guid>
		<description><![CDATA[<a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip/" title="GZIP"></a>GZIP(1) GZIP(1) NAME gzip, gunzip, zcat &#8211; compress or expand files SYNOPSIS gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] zcat [ -fhLV ] [ name ... ] &#8230;<p class="read-more"><a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip/" title="GZIP"></a><p>GZIP(1)                                                                GZIP(1)</p>
<p>NAME<br />       gzip, gunzip, zcat &#8211; compress or expand files</p>
<p>SYNOPSIS<br />       gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ...  ]<br />       gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ...  ]<br />       zcat [ -fhLV ] [ name ...  ]</p>
<p>DESCRIPTION<br />       Gzip  reduces  the  size  of  the  named  files using Lempel-Ziv coding<br />       (LZ77).  Whenever possible, each file  is  replaced  by  one  with  the<br />       extension .gz, while keeping the same ownership modes, access and modi-<br />       fication times.  (The default extension is -gz for VMS,  z  for  MSDOS,<br />       OS/2  FAT, Windows NT FAT and Atari.)  If no files are specified, or if<br />       a file name is &#8220;-&#8221;, the standard input is compressed  to  the  standard<br />       output.  Gzip will only attempt to compress regular files.  In particu-<br />       lar, it will ignore symbolic links.</p>
<p>       If the compressed file name is too long for its file system, gzip trun-<br />       cates  it.   Gzip  attempts to truncate only the parts of the file name<br />       longer than 3 characters.  (A part is delimited by dots.) If  the  name<br />       consists  of  small  parts  only,  the longest parts are truncated. For<br />       example, if file names are limited to 14 characters, <a>gzip.msdos.exe</a>  is<br />       compressed to <a>gzi.msd.exe.gz</a>.  Names are not truncated on systems which<br />       do not have a limit on file name length.</p>
<p>       By default, gzip keeps the original file name and timestamp in the com-<br />       pressed  file.  These  are used when decompressing the file with the -N<br />       option. This is useful when the compressed file name was  truncated  or<br />       when the time stamp was not preserved after a file transfer.</p>
<p>       Compressed  files  can be restored to their original form using gzip -d<br />       or gunzip or zcat.  If the original name saved in the  compressed  file<br />       is not suitable for its file system, a new name is constructed from the<br />       original one to make it legal.</p>
<p>       gunzip takes a list of files on its command line and replaces each file<br />       whose  name  ends with .gz, -gz, .z, -z, _z or .Z and which begins with<br />       the correct magic number with an uncompressed file without the original<br />       extension.  gunzip also recognizes the special extensions .tgz and .taz<br />       as shorthands for .tar.gz and .tar.Z respectively.   When  compressing,<br />       gzip  uses the .tgz extension if necessary instead of truncating a file<br />       with a .tar extension.</p>
<p>       gunzip can currently decompress files created by gzip,  zip,  compress,<br />       compress  -H  or pack.  The detection of the input format is automatic.<br />       When using the first two formats, gunzip checks a 32 bit CRC. For pack,<br />       gunzip checks the uncompressed length. The standard compress format was<br />       not designed to allow consistency checks. However gunzip  is  sometimes<br />       able  to detect a bad .Z file. If you get an error when uncompressing a<br />       .Z file, do not assume that the .Z file is correct simply  because  the<br />       standard  uncompress  does  not complain. This generally means that the<br />       standard uncompress does not check its  input,  and  happily  generates<br />       garbage  output.   The  SCO compress -H format (lzh compression method)<br />       does not include a CRC but also allows some consistency checks.</p>
<p>       Files created by zip can be uncompressed by gzip only if  they  have  a<br />       single  member  compressed with the &#8216;deflation&#8217; method. This feature is<br />       only intended to help conversion of <a>tar.zip</a> files to the <a>tar.gz</a> format.<br />       To  extract  a zip file with a single member, use a command like gunzip<br />       &lt;<a>foo.zip</a> or gunzip -S .zip <a>foo.zip</a>.  To extract zip files with  several<br />       members, use unzip instead of gunzip.</p>
<p>       zcat  is  identical  to  gunzip  -c.   (On  some  systems,  zcat may be<br />       installed as gzcat to preserve the original link  to  compress.)   zcat<br />       uncompresses either a list of files on the command line or its standard<br />       input and writes the uncompressed data on standard output.   zcat  will<br />       uncompress files that have the correct magic number whether they have a<br />       .gz suffix or not.</p>
<p>       Gzip uses the Lempel-Ziv algorithm used in zip and PKZIP.   The  amount<br />       of  compression  obtained depends on the size of the input and the dis-<br />       tribution of common substrings.  Typically, text such as source code or<br />       English  is  reduced  by  60-70%.  Compression is generally much better<br />       than that achieved by LZW (as used in  compress),  Huffman  coding  (as<br />       used in pack), or adaptive Huffman coding (compact).</p>
<p>       Compression  is  always  performed,  even  if  the  compressed  file is<br />       slightly larger than the original. The worst case expansion  is  a  few<br />       bytes  for  the  gzip  file header, plus 5 bytes every 32K block, or an<br />       expansion ratio of 0.015% for large files. Note that the actual  number<br />       of  used  disk blocks almost never increases.  gzip preserves the mode,<br />       ownership and timestamps of files when compressing or decompressing.</p>
<p>       The gzip file format is specified in P. Deutsch, GZIP file format spec-<br />       ification version 4.3, &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1952.txt">ftp://ftp.isi.edu/in-notes/rfc1952.txt</a>&gt;, Inter-<br />       net RFC 1952 (May 1996).  The zip deflation format is specified  in  P.<br />       Deutsch,  DEFLATE  Compressed  Data  Format  Specification version 1.3,<br />       &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1951.txt">ftp://ftp.isi.edu/in-notes/rfc1951.txt</a>&gt;, Internet RFC 1951 (May 1996).</p>
<p>OPTIONS<br />       -a &#8211;ascii<br />              Ascii  text  mode: convert end-of-lines using local conventions.<br />              This option is supported only  on  some  non-Unix  systems.  For<br />              MSDOS, CR LF is converted to LF when compressing, and LF is con-<br />              verted to CR LF when decompressing.</p>
<p>       -c &#8211;stdout &#8211;to-stdout<br />              Write output on standard output; keep original files  unchanged.<br />              If  there  are  several  input  files,  the output consists of a<br />              sequence of independently compressed members. To  obtain  better<br />              compression,  concatenate  all  input  files  before compressing<br />              them.</p>
<p>       -d &#8211;decompress &#8211;uncompress<br />              Decompress.</p>
<p>       -f &#8211;force<br />              Force compression or decompression even if the file has multiple<br />              links  or  the corresponding file already exists, or if the com-<br />              pressed data is read from or written to a terminal. If the input<br />              data  is  not  in a format recognized by gzip, and if the option<br />              &#8211;stdout is also given, copy the input data  without  change  to<br />              the  standard  output:  let  zcat  behave  as cat.  If -f is not<br />              given, and when not running in the background, gzip  prompts  to<br />              verify whether an existing file should be overwritten.</p>
<p>       -h &#8211;help<br />              Display a help screen and quit.</p>
<p>       -l &#8211;list<br />              For each compressed file, list the following fields:</p>
<p>                  compressed size: size of the compressed file<br />                  uncompressed size: size of the uncompressed file<br />                  ratio: compression ratio (0.0% if unknown)<br />                  uncompressed_name: name of the uncompressed file</p>
<p>              The  uncompressed size is given as -1 for files not in gzip for-<br />              mat, such as compressed .Z files. To get the  uncompressed  size<br />              for such a file, you can use:</p>
<p>                  zcat file.Z | wc -c</p>
<p>              In  combination  with the &#8211;verbose option, the following fields<br />              are also displayed:</p>
<p>                  method: compression method<br />                  crc: the 32-bit CRC of the uncompressed data<br />                  date &amp; time: time stamp for the uncompressed file</p>
<p>              The compression methods currently supported  are  deflate,  com-<br />              press,  lzh  (SCO  compress  -H)  and pack.  The crc is given as<br />              ffffffff for a file not in gzip format.</p>
<p>              With &#8211;name, the uncompressed name,  date and  time   are  those<br />              stored within the compress file if present.</p>
<p>              With  &#8211;verbose,  the  size totals and compression ratio for all<br />              files is also displayed, unless some  sizes  are  unknown.  With<br />              &#8211;quiet, the title and totals lines are not displayed.</p>
<p>       -L &#8211;license<br />              Display the gzip license and quit.</p>
<p>       -n &#8211;no-name<br />              When  compressing,  do  not save the original file name and time<br />              stamp by default. (The original name is always saved if the name<br />              had  to  be  truncated.)  When decompressing, do not restore the<br />              original file name if present (remove only the gzip suffix  from<br />              the  compressed  file name) and do not restore the original time<br />              stamp if present (copy it from the compressed file). This option<br />              is the default when decompressing.</p>
<p>       -N &#8211;name<br />              When  compressing,  always  save the original file name and time<br />              stamp; this is the  default.  When  decompressing,  restore  the<br />              original  file  name  and  time stamp if present. This option is<br />              useful on systems which have a limit on file name length or when<br />              the time stamp has been lost after a file transfer.</p>
<p>       -q &#8211;quiet<br />              Suppress all warnings.</p>
<p>       -r &#8211;recursive<br />              Travel  the  directory structure recursively. If any of the file<br />              names specified on the command line are directories,  gzip  will<br />              descend  into  the directory and compress all the files it finds<br />              there (or decompress them in the case of gunzip ).</p>
<p>       -S .suf &#8211;suffix .suf<br />              Use suffix .suf instead of .gz. Any suffix  can  be  given,  but<br />              suffixes other than .z and .gz should be avoided to avoid confu-<br />              sion when files are transferred to other systems.  A null suffix<br />              forces  gunzip  to  try decompression on all given files regard-<br />              less of suffix, as in:</p>
<p>                  gunzip -S &#8220;&#8221; *       (*.* for MSDOS)</p>
<p>              Previous versions of gzip used the .z suffix. This  was  changed<br />              to avoid a conflict with pack(1).</p>
<p>       -t &#8211;test<br />              Test. Check the compressed file integrity.</p>
<p>       -v &#8211;verbose<br />              Verbose. Display the name and percentage reduction for each file<br />              compressed or decompressed.</p>
<p>       -V &#8211;version<br />              Version. Display the version number and compilation options then<br />              quit.</p>
<p>       -# &#8211;fast &#8211;best<br />              Regulate  the  speed of compression using the specified digit #,<br />              where -1 or &#8211;fast  indicates  the  fastest  compression  method<br />              (less  compression)  and -9 or &#8211;best indicates the slowest com-<br />              pression method (best  compression).   The  default  compression<br />              level is -6 (that is, biased towards high compression at expense<br />              of speed).</p>
<p>ADVANCED USAGE<br />       Multiple compressed files can be concatenated.  In  this  case,  gunzip<br />       will extract all members at once. For example:</p>
<p>             gzip -c file1  &gt; <a>foo.gz</a><br />             gzip -c file2 &gt;&gt; <a>foo.gz</a></p>
<p>       Then</p>
<p>             gunzip -c foo</p>
<p>       is equivalent to</p>
<p>             cat file1 file2</p>
<p>       In  case of damage to one member of a .gz file, other members can still<br />       be recovered (if the damaged member is removed). However, you  can  get<br />       better compression by compressing all members at once:</p>
<p>             cat file1 file2 | gzip &gt; <a>foo.gz</a></p>
<p>       compresses better than</p>
<p>             gzip -c file1 file2 &gt; <a>foo.gz</a></p>
<p>       If you want to recompress concatenated files to get better compression,<br />       do:</p>
<p>             gzip -cd <a>old.gz</a> | gzip &gt; <a>new.gz</a></p>
<p>       If a compressed file consists of several members, the uncompressed size<br />       and  CRC reported by the &#8211;list option applies to the last member only.<br />       If you need the uncompressed size for all members, you can use:</p>
<p>             gzip -cd <a>file.gz</a> | wc -c</p>
<p>       If you wish to create a single archive file with  multiple  members  so<br />       that members can later be extracted independently, use an archiver such<br />       as tar or zip. GNU tar supports the -z option to invoke gzip  transpar-<br />       ently. gzip is designed as a complement to tar, not as a replacement.</p>
<p>ENVIRONMENT<br />       The  environment  variable  GZIP  can hold a set of default options for<br />       gzip.  These options are interpreted first and can  be  overwritten  by<br />       explicit command line parameters. For example:<br />             for sh:    GZIP=&#8221;-8v &#8211;name&#8221;; export GZIP<br />             for csh:   setenv GZIP &#8220;-8v &#8211;name&#8221;<br />             for MSDOS: set GZIP=-8v &#8211;name</p>
<p>       On  Vax/VMS, the name of the environment variable is GZIP_OPT, to avoid<br />       a conflict with the symbol set for invocation of the program.</p>
<p>SEE ALSO<br />       znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), com-<br />       press(1), pack(1), compact(1)</p>
<p>       The gzip file format is specified in P. Deutsch, GZIP file format spec-<br />       ification version 4.3, &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1952.txt">ftp://ftp.isi.edu/in-notes/rfc1952.txt</a>&gt;, Inter-<br />       net  RFC  1952 (May 1996).  The zip deflation format is specified in P.<br />       Deutsch, DEFLATE Compressed  Data  Format  Specification  version  1.3,<br />       &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1951.txt">ftp://ftp.isi.edu/in-notes/rfc1951.txt</a>&gt;, Internet RFC 1951 (May 1996).</p>
<p>DIAGNOSTICS<br />       Exit status is normally 0; if an error occurs, exit status is 1.  If  a<br />       warning occurs, exit status is 2.</p>
<p>       Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]<br />              Invalid options were specified on the command line.</p>
<p>       file: not in gzip format<br />              The file specified to gunzip has not been compressed.</p>
<p>       file: Corrupt input. Use zcat to recover some data.<br />              The  compressed  file has been damaged. The data up to the point<br />              of failure can be recovered using</p>
<p>                    zcat file &gt; recover</p>
<p>       file: compressed with xx bits, can only handle yy bits<br />              File was compressed (using LZW) by a  program  that  could  deal<br />              with more bits than the decompress code on this machine.  Recom-<br />              press the file with gzip, which compresses better and uses  less<br />              memory.</p>
<p>       file: already has .gz suffix &#8212; no change<br />              The  file  is assumed to be already compressed.  Rename the file<br />              and try again.</p>
<p>       file already exists; do you wish to overwrite (y or n)?<br />              Respond &#8220;y&#8221; if you want the output file to be replaced;  &#8220;n&#8221;  if<br />              not.</p>
<p>       gunzip: corrupt input<br />              A  SIGSEGV  violation  was detected which usually means that the<br />              input file has been corrupted.</p>
<p>       xx.x% Percentage of the input saved by compression.<br />              (Relevant only for -v and -l.)</p>
<p>       &#8212; not a regular file or directory: ignored<br />              When the input file is not a regular file or directory, (e.g.  a<br />              symbolic link, socket, FIFO, device file), it is left unaltered.</p>
<p>       &#8212; has xx other links: unchanged<br />              The input file has links; it is left unchanged.  See  ln(1)  for<br />              more information. Use the -f flag to force compression of multi-<br />              ply-linked files.</p>
<p>CAVEATS<br />       When writing compressed data to a tape, it is  generally  necessary  to<br />       pad  the  output  with  zeroes up to a block boundary. When the data is<br />       read and the whole block is passed to gunzip for decompression,  gunzip<br />       detects  that there is extra trailing garbage after the compressed data<br />       and emits a warning by default. You have to use the &#8211;quiet  option  to<br />       suppress  the  warning.  This option can be set in the GZIP environment<br />       variable as in:<br />         for sh:  GZIP=&#8221;-q&#8221;  tar -xfz &#8211;block-compress /dev/rst0<br />         for csh: (setenv GZIP -q; tar -xfz &#8211;block-compr /dev/rst0</p>
<p>       In the above example, gzip is invoked implicitly by the  -z  option  of<br />       GNU  tar. Make sure that the same block size (-b option of tar) is used<br />       for reading and  writing  compressed  data  on  tapes.   (This  example<br />       assumes you are using the GNU version of tar.)</p>
<p>BUGS<br />       The  gzip  format  represents the input size modulo 2^32, so the &#8211;list<br />       option reports incorrect uncompressed sizes and compression ratios  for<br />       uncompressed  files  4 GB and larger.  To work around this problem, you<br />       can use the following command to discover a large  uncompressed  file&#8217;s<br />       true size:</p>
<p>             zcat <a>file.gz</a> | wc -c</p>
<p>       The  &#8211;list  option reports sizes as -1 and crc as ffffffff if the com-<br />       pressed file is on a non seekable media.</p>
<p>       In some rare cases, the &#8211;best option gives worse compression than  the<br />       default  compression  level  (-6). On some highly redundant files, com-<br />       press compresses better than gzip.</p>
<p>COPYRIGHT NOTICE<br />       Copyright Â© 1998, 1999, 2001, 2002 Free Software Foundation, Inc.<br />       Copyright Â© 1992, 1993 Jean-loup Gailly</p>
<p>       Permission is granted to make and distribute verbatim  copies  of  this<br />       manual  provided  the  copyright  notice and this permission notice are<br />       preserved on all copies.</p>
<p>       Permission is granted to copy and distribute modified versions of  this<br />       manual  under  the  conditions  for verbatim copying, provided that the<br />       entire resulting derived work is distributed under the terms of a  per-<br />       mission notice identical to this one.</p>
<p>       Permission  is granted to copy and distribute translations of this man-<br />       ual into another language, under the above conditions for modified ver-<br />       sions,  except  that this permission notice may be stated in a transla-<br />       tion approved by the Foundation.</p>
<p>                                     local                             GZIP(1)</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=05ae8792-c44c-4c8a-bb65-3f185d10201e" /></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/GZIP' rel='tag' target='_self'>GZIP</a>, <a class='technorati-link' href='http://technorati.com/tag/Linux+Man+Pages' rel='tag' target='_self'>Linux Man Pages</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/" title="GZIP">GZIP</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/" title="GZIP">GZIP</a></li><li>January 4, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/04/sort/" title="SORT">SORT</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/mkdirhier/" title="MKDIRHIER">MKDIRHIER</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/modinfo/" title="MODINFO">MODINFO</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/linux-man-pages/2009/01/01/gzip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GZIP</title>
		<link>http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/</link>
		<comments>http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 17:14:00 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[Linux Man Pages]]></category>
		<category><![CDATA[GZIP]]></category>

		<guid isPermaLink="false">http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/</guid>
		<description><![CDATA[<a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/" title="GZIP"></a>GZIP(1) GZIP(1) NAME gzip, gunzip, zcat &#8211; compress or expand files SYNOPSIS gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] zcat [ -fhLV ] [ name ... ] &#8230;<p class="read-more"><a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/" title="GZIP"></a><p>GZIP(1)                                                                GZIP(1)</p>
<p>NAME<br />       gzip, gunzip, zcat &#8211; compress or expand files</p>
<p>SYNOPSIS<br />       gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ...  ]<br />       gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ...  ]<br />       zcat [ -fhLV ] [ name ...  ]</p>
<p>DESCRIPTION<br />       Gzip  reduces  the  size  of  the  named  files using Lempel-Ziv coding<br />       (LZ77).  Whenever possible, each file  is  replaced  by  one  with  the<br />       extension .gz, while keeping the same ownership modes, access and modi-<br />       fication times.  (The default extension is -gz for VMS,  z  for  MSDOS,<br />       OS/2  FAT, Windows NT FAT and Atari.)  If no files are specified, or if<br />       a file name is &#8220;-&#8221;, the standard input is compressed  to  the  standard<br />       output.  Gzip will only attempt to compress regular files.  In particu-<br />       lar, it will ignore symbolic links.</p>
<p>       If the compressed file name is too long for its file system, gzip trun-<br />       cates  it.   Gzip  attempts to truncate only the parts of the file name<br />       longer than 3 characters.  (A part is delimited by dots.) If  the  name<br />       consists  of  small  parts  only,  the longest parts are truncated. For<br />       example, if file names are limited to 14 characters, <a>gzip.msdos.exe</a>  is<br />       compressed to <a>gzi.msd.exe.gz</a>.  Names are not truncated on systems which<br />       do not have a limit on file name length.</p>
<p>       By default, gzip keeps the original file name and timestamp in the com-<br />       pressed  file.  These  are used when decompressing the file with the -N<br />       option. This is useful when the compressed file name was  truncated  or<br />       when the time stamp was not preserved after a file transfer.</p>
<p>       Compressed  files  can be restored to their original form using gzip -d<br />       or gunzip or zcat.  If the original name saved in the  compressed  file<br />       is not suitable for its file system, a new name is constructed from the<br />       original one to make it legal.</p>
<p>       gunzip takes a list of files on its command line and replaces each file<br />       whose  name  ends with .gz, -gz, .z, -z, _z or .Z and which begins with<br />       the correct magic number with an uncompressed file without the original<br />       extension.  gunzip also recognizes the special extensions .tgz and .taz<br />       as shorthands for .tar.gz and .tar.Z respectively.   When  compressing,<br />       gzip  uses the .tgz extension if necessary instead of truncating a file<br />       with a .tar extension.</p>
<p>       gunzip can currently decompress files created by gzip,  zip,  compress,<br />       compress  -H  or pack.  The detection of the input format is automatic.<br />       When using the first two formats, gunzip checks a 32 bit CRC. For pack,<br />       gunzip checks the uncompressed length. The standard compress format was<br />       not designed to allow consistency checks. However gunzip  is  sometimes<br />       able  to detect a bad .Z file. If you get an error when uncompressing a<br />       .Z file, do not assume that the .Z file is correct simply  because  the<br />       standard  uncompress  does  not complain. This generally means that the<br />       standard uncompress does not check its  input,  and  happily  generates<br />       garbage  output.   The  SCO compress -H format (lzh compression method)<br />       does not include a CRC but also allows some consistency checks.</p>
<p>       Files created by zip can be uncompressed by gzip only if  they  have  a<br />       single  member  compressed with the &#8216;deflation&#8217; method. This feature is<br />       only intended to help conversion of <a>tar.zip</a> files to the <a>tar.gz</a> format.<br />       To  extract  a zip file with a single member, use a command like gunzip<br />       &lt;<a>foo.zip</a> or gunzip -S .zip <a>foo.zip</a>.  To extract zip files with  several<br />       members, use unzip instead of gunzip.</p>
<p>       zcat  is  identical  to  gunzip  -c.   (On  some  systems,  zcat may be<br />       installed as gzcat to preserve the original link  to  compress.)   zcat<br />       uncompresses either a list of files on the command line or its standard<br />       input and writes the uncompressed data on standard output.   zcat  will<br />       uncompress files that have the correct magic number whether they have a<br />       .gz suffix or not.</p>
<p>       Gzip uses the Lempel-Ziv algorithm used in zip and PKZIP.   The  amount<br />       of  compression  obtained depends on the size of the input and the dis-<br />       tribution of common substrings.  Typically, text such as source code or<br />       English  is  reduced  by  60-70%.  Compression is generally much better<br />       than that achieved by LZW (as used in  compress),  Huffman  coding  (as<br />       used in pack), or adaptive Huffman coding (compact).</p>
<p>       Compression  is  always  performed,  even  if  the  compressed  file is<br />       slightly larger than the original. The worst case expansion  is  a  few<br />       bytes  for  the  gzip  file header, plus 5 bytes every 32K block, or an<br />       expansion ratio of 0.015% for large files. Note that the actual  number<br />       of  used  disk blocks almost never increases.  gzip preserves the mode,<br />       ownership and timestamps of files when compressing or decompressing.</p>
<p>       The gzip file format is specified in P. Deutsch, GZIP file format spec-<br />       ification version 4.3, &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1952.txt">ftp://ftp.isi.edu/in-notes/rfc1952.txt</a>&gt;, Inter-<br />       net RFC 1952 (May 1996).  The zip deflation format is specified  in  P.<br />       Deutsch,  DEFLATE  Compressed  Data  Format  Specification version 1.3,<br />       &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1951.txt">ftp://ftp.isi.edu/in-notes/rfc1951.txt</a>&gt;, Internet RFC 1951 (May 1996).</p>
<p>OPTIONS<br />       -a &#8211;ascii<br />              Ascii  text  mode: convert end-of-lines using local conventions.<br />              This option is supported only  on  some  non-Unix  systems.  For<br />              MSDOS, CR LF is converted to LF when compressing, and LF is con-<br />              verted to CR LF when decompressing.</p>
<p>       -c &#8211;stdout &#8211;to-stdout<br />              Write output on standard output; keep original files  unchanged.<br />              If  there  are  several  input  files,  the output consists of a<br />              sequence of independently compressed members. To  obtain  better<br />              compression,  concatenate  all  input  files  before compressing<br />              them.</p>
<p>       -d &#8211;decompress &#8211;uncompress<br />              Decompress.</p>
<p>       -f &#8211;force<br />              Force compression or decompression even if the file has multiple<br />              links  or  the corresponding file already exists, or if the com-<br />              pressed data is read from or written to a terminal. If the input<br />              data  is  not  in a format recognized by gzip, and if the option<br />              &#8211;stdout is also given, copy the input data  without  change  to<br />              the  standard  output:  let  zcat  behave  as cat.  If -f is not<br />              given, and when not running in the background, gzip  prompts  to<br />              verify whether an existing file should be overwritten.</p>
<p>       -h &#8211;help<br />              Display a help screen and quit.</p>
<p>       -l &#8211;list<br />              For each compressed file, list the following fields:</p>
<p>                  compressed size: size of the compressed file<br />                  uncompressed size: size of the uncompressed file<br />                  ratio: compression ratio (0.0% if unknown)<br />                  uncompressed_name: name of the uncompressed file</p>
<p>              The  uncompressed size is given as -1 for files not in gzip for-<br />              mat, such as compressed .Z files. To get the  uncompressed  size<br />              for such a file, you can use:</p>
<p>                  zcat file.Z | wc -c</p>
<p>              In  combination  with the &#8211;verbose option, the following fields<br />              are also displayed:</p>
<p>                  method: compression method<br />                  crc: the 32-bit CRC of the uncompressed data<br />                  date &amp; time: time stamp for the uncompressed file</p>
<p>              The compression methods currently supported  are  deflate,  com-<br />              press,  lzh  (SCO  compress  -H)  and pack.  The crc is given as<br />              ffffffff for a file not in gzip format.</p>
<p>              With &#8211;name, the uncompressed name,  date and  time   are  those<br />              stored within the compress file if present.</p>
<p>              With  &#8211;verbose,  the  size totals and compression ratio for all<br />              files is also displayed, unless some  sizes  are  unknown.  With<br />              &#8211;quiet, the title and totals lines are not displayed.</p>
<p>       -L &#8211;license<br />              Display the gzip license and quit.</p>
<p>       -n &#8211;no-name<br />              When  compressing,  do  not save the original file name and time<br />              stamp by default. (The original name is always saved if the name<br />              had  to  be  truncated.)  When decompressing, do not restore the<br />              original file name if present (remove only the gzip suffix  from<br />              the  compressed  file name) and do not restore the original time<br />              stamp if present (copy it from the compressed file). This option<br />              is the default when decompressing.</p>
<p>       -N &#8211;name<br />              When  compressing,  always  save the original file name and time<br />              stamp; this is the  default.  When  decompressing,  restore  the<br />              original  file  name  and  time stamp if present. This option is<br />              useful on systems which have a limit on file name length or when<br />              the time stamp has been lost after a file transfer.</p>
<p>       -q &#8211;quiet<br />              Suppress all warnings.</p>
<p>       -r &#8211;recursive<br />              Travel  the  directory structure recursively. If any of the file<br />              names specified on the command line are directories,  gzip  will<br />              descend  into  the directory and compress all the files it finds<br />              there (or decompress them in the case of gunzip ).</p>
<p>       -S .suf &#8211;suffix .suf<br />              Use suffix .suf instead of .gz. Any suffix  can  be  given,  but<br />              suffixes other than .z and .gz should be avoided to avoid confu-<br />              sion when files are transferred to other systems.  A null suffix<br />              forces  gunzip  to  try decompression on all given files regard-<br />              less of suffix, as in:</p>
<p>                  gunzip -S &#8220;&#8221; *       (*.* for MSDOS)</p>
<p>              Previous versions of gzip used the .z suffix. This  was  changed<br />              to avoid a conflict with pack(1).</p>
<p>       -t &#8211;test<br />              Test. Check the compressed file integrity.</p>
<p>       -v &#8211;verbose<br />              Verbose. Display the name and percentage reduction for each file<br />              compressed or decompressed.</p>
<p>       -V &#8211;version<br />              Version. Display the version number and compilation options then<br />              quit.</p>
<p>       -# &#8211;fast &#8211;best<br />              Regulate  the  speed of compression using the specified digit #,<br />              where -1 or &#8211;fast  indicates  the  fastest  compression  method<br />              (less  compression)  and -9 or &#8211;best indicates the slowest com-<br />              pression method (best  compression).   The  default  compression<br />              level is -6 (that is, biased towards high compression at expense<br />              of speed).</p>
<p>ADVANCED USAGE<br />       Multiple compressed files can be concatenated.  In  this  case,  gunzip<br />       will extract all members at once. For example:</p>
<p>             gzip -c file1  &gt; <a>foo.gz</a><br />             gzip -c file2 &gt;&gt; <a>foo.gz</a></p>
<p>       Then</p>
<p>             gunzip -c foo</p>
<p>       is equivalent to</p>
<p>             cat file1 file2</p>
<p>       In  case of damage to one member of a .gz file, other members can still<br />       be recovered (if the damaged member is removed). However, you  can  get<br />       better compression by compressing all members at once:</p>
<p>             cat file1 file2 | gzip &gt; <a>foo.gz</a></p>
<p>       compresses better than</p>
<p>             gzip -c file1 file2 &gt; <a>foo.gz</a></p>
<p>       If you want to recompress concatenated files to get better compression,<br />       do:</p>
<p>             gzip -cd <a>old.gz</a> | gzip &gt; <a>new.gz</a></p>
<p>       If a compressed file consists of several members, the uncompressed size<br />       and  CRC reported by the &#8211;list option applies to the last member only.<br />       If you need the uncompressed size for all members, you can use:</p>
<p>             gzip -cd <a>file.gz</a> | wc -c</p>
<p>       If you wish to create a single archive file with  multiple  members  so<br />       that members can later be extracted independently, use an archiver such<br />       as tar or zip. GNU tar supports the -z option to invoke gzip  transpar-<br />       ently. gzip is designed as a complement to tar, not as a replacement.</p>
<p>ENVIRONMENT<br />       The  environment  variable  GZIP  can hold a set of default options for<br />       gzip.  These options are interpreted first and can  be  overwritten  by<br />       explicit command line parameters. For example:<br />             for sh:    GZIP=&#8221;-8v &#8211;name&#8221;; export GZIP<br />             for csh:   setenv GZIP &#8220;-8v &#8211;name&#8221;<br />             for MSDOS: set GZIP=-8v &#8211;name</p>
<p>       On  Vax/VMS, the name of the environment variable is GZIP_OPT, to avoid<br />       a conflict with the symbol set for invocation of the program.</p>
<p>SEE ALSO<br />       znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), com-<br />       press(1), pack(1), compact(1)</p>
<p>       The gzip file format is specified in P. Deutsch, GZIP file format spec-<br />       ification version 4.3, &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1952.txt">ftp://ftp.isi.edu/in-notes/rfc1952.txt</a>&gt;, Inter-<br />       net  RFC  1952 (May 1996).  The zip deflation format is specified in P.<br />       Deutsch, DEFLATE Compressed  Data  Format  Specification  version  1.3,<br />       &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1951.txt">ftp://ftp.isi.edu/in-notes/rfc1951.txt</a>&gt;, Internet RFC 1951 (May 1996).</p>
<p>DIAGNOSTICS<br />       Exit status is normally 0; if an error occurs, exit status is 1.  If  a<br />       warning occurs, exit status is 2.</p>
<p>       Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]<br />              Invalid options were specified on the command line.</p>
<p>       file: not in gzip format<br />              The file specified to gunzip has not been compressed.</p>
<p>       file: Corrupt input. Use zcat to recover some data.<br />              The  compressed  file has been damaged. The data up to the point<br />              of failure can be recovered using</p>
<p>                    zcat file &gt; recover</p>
<p>       file: compressed with xx bits, can only handle yy bits<br />              File was compressed (using LZW) by a  program  that  could  deal<br />              with more bits than the decompress code on this machine.  Recom-<br />              press the file with gzip, which compresses better and uses  less<br />              memory.</p>
<p>       file: already has .gz suffix &#8212; no change<br />              The  file  is assumed to be already compressed.  Rename the file<br />              and try again.</p>
<p>       file already exists; do you wish to overwrite (y or n)?<br />              Respond &#8220;y&#8221; if you want the output file to be replaced;  &#8220;n&#8221;  if<br />              not.</p>
<p>       gunzip: corrupt input<br />              A  SIGSEGV  violation  was detected which usually means that the<br />              input file has been corrupted.</p>
<p>       xx.x% Percentage of the input saved by compression.<br />              (Relevant only for -v and -l.)</p>
<p>       &#8212; not a regular file or directory: ignored<br />              When the input file is not a regular file or directory, (e.g.  a<br />              symbolic link, socket, FIFO, device file), it is left unaltered.</p>
<p>       &#8212; has xx other links: unchanged<br />              The input file has links; it is left unchanged.  See  ln(1)  for<br />              more information. Use the -f flag to force compression of multi-<br />              ply-linked files.</p>
<p>CAVEATS<br />       When writing compressed data to a tape, it is  generally  necessary  to<br />       pad  the  output  with  zeroes up to a block boundary. When the data is<br />       read and the whole block is passed to gunzip for decompression,  gunzip<br />       detects  that there is extra trailing garbage after the compressed data<br />       and emits a warning by default. You have to use the &#8211;quiet  option  to<br />       suppress  the  warning.  This option can be set in the GZIP environment<br />       variable as in:<br />         for sh:  GZIP=&#8221;-q&#8221;  tar -xfz &#8211;block-compress /dev/rst0<br />         for csh: (setenv GZIP -q; tar -xfz &#8211;block-compr /dev/rst0</p>
<p>       In the above example, gzip is invoked implicitly by the  -z  option  of<br />       GNU  tar. Make sure that the same block size (-b option of tar) is used<br />       for reading and  writing  compressed  data  on  tapes.   (This  example<br />       assumes you are using the GNU version of tar.)</p>
<p>BUGS<br />       The  gzip  format  represents the input size modulo 2^32, so the &#8211;list<br />       option reports incorrect uncompressed sizes and compression ratios  for<br />       uncompressed  files  4 GB and larger.  To work around this problem, you<br />       can use the following command to discover a large  uncompressed  file&#8217;s<br />       true size:</p>
<p>             zcat <a>file.gz</a> | wc -c</p>
<p>       The  &#8211;list  option reports sizes as -1 and crc as ffffffff if the com-<br />       pressed file is on a non seekable media.</p>
<p>       In some rare cases, the &#8211;best option gives worse compression than  the<br />       default  compression  level  (-6). On some highly redundant files, com-<br />       press compresses better than gzip.</p>
<p>COPYRIGHT NOTICE<br />       Copyright Â© 1998, 1999, 2001, 2002 Free Software Foundation, Inc.<br />       Copyright Â© 1992, 1993 Jean-loup Gailly</p>
<p>       Permission is granted to make and distribute verbatim  copies  of  this<br />       manual  provided  the  copyright  notice and this permission notice are<br />       preserved on all copies.</p>
<p>       Permission is granted to copy and distribute modified versions of  this<br />       manual  under  the  conditions  for verbatim copying, provided that the<br />       entire resulting derived work is distributed under the terms of a  per-<br />       mission notice identical to this one.</p>
<p>       Permission  is granted to copy and distribute translations of this man-<br />       ual into another language, under the above conditions for modified ver-<br />       sions,  except  that this permission notice may be stated in a transla-<br />       tion approved by the Foundation.</p>
<p>                                     local                             GZIP(1)</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=fc2bbe38-3b8b-4301-810e-a88e65050383" /></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/GZIP' rel='tag' target='_self'>GZIP</a>, <a class='technorati-link' href='http://technorati.com/tag/Linux+Man+Pages' rel='tag' target='_self'>Linux Man Pages</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip/" title="GZIP">GZIP</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/" title="GZIP">GZIP</a></li><li>January 4, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/04/sort/" title="SORT">SORT</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/mkdirhier/" title="MKDIRHIER">MKDIRHIER</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/modinfo/" title="MODINFO">MODINFO</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GZIP</title>
		<link>http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/</link>
		<comments>http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 13:42:00 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[Linux Man Pages]]></category>
		<category><![CDATA[GZIP]]></category>

		<guid isPermaLink="false">http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/</guid>
		<description><![CDATA[<a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/" title="GZIP"></a>GZIP(1) GZIP(1) NAME gzip, gunzip, zcat &#8211; compress or expand files SYNOPSIS gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] zcat [ -fhLV ] [ name ... ] &#8230;<p class="read-more"><a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/" title="GZIP"></a><p>GZIP(1)                                                                GZIP(1)</p>
<p>NAME<br />       gzip, gunzip, zcat &#8211; compress or expand files</p>
<p>SYNOPSIS<br />       gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ...  ]<br />       gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ...  ]<br />       zcat [ -fhLV ] [ name ...  ]</p>
<p>DESCRIPTION<br />       Gzip  reduces  the  size  of  the  named  files using Lempel-Ziv coding<br />       (LZ77).  Whenever possible, each file  is  replaced  by  one  with  the<br />       extension .gz, while keeping the same ownership modes, access and modi-<br />       fication times.  (The default extension is -gz for VMS,  z  for  MSDOS,<br />       OS/2  FAT, Windows NT FAT and Atari.)  If no files are specified, or if<br />       a file name is &#8220;-&#8221;, the standard input is compressed  to  the  standard<br />       output.  Gzip will only attempt to compress regular files.  In particu-<br />       lar, it will ignore symbolic links.</p>
<p>       If the compressed file name is too long for its file system, gzip trun-<br />       cates  it.   Gzip  attempts to truncate only the parts of the file name<br />       longer than 3 characters.  (A part is delimited by dots.) If  the  name<br />       consists  of  small  parts  only,  the longest parts are truncated. For<br />       example, if file names are limited to 14 characters, <a>gzip.msdos.exe</a>  is<br />       compressed to <a>gzi.msd.exe.gz</a>.  Names are not truncated on systems which<br />       do not have a limit on file name length.</p>
<p>       By default, gzip keeps the original file name and timestamp in the com-<br />       pressed  file.  These  are used when decompressing the file with the -N<br />       option. This is useful when the compressed file name was  truncated  or<br />       when the time stamp was not preserved after a file transfer.</p>
<p>       Compressed  files  can be restored to their original form using gzip -d<br />       or gunzip or zcat.  If the original name saved in the  compressed  file<br />       is not suitable for its file system, a new name is constructed from the<br />       original one to make it legal.</p>
<p>       gunzip takes a list of files on its command line and replaces each file<br />       whose  name  ends with .gz, -gz, .z, -z, _z or .Z and which begins with<br />       the correct magic number with an uncompressed file without the original<br />       extension.  gunzip also recognizes the special extensions .tgz and .taz<br />       as shorthands for .tar.gz and .tar.Z respectively.   When  compressing,<br />       gzip  uses the .tgz extension if necessary instead of truncating a file<br />       with a .tar extension.</p>
<p>       gunzip can currently decompress files created by gzip,  zip,  compress,<br />       compress  -H  or pack.  The detection of the input format is automatic.<br />       When using the first two formats, gunzip checks a 32 bit CRC. For pack,<br />       gunzip checks the uncompressed length. The standard compress format was<br />       not designed to allow consistency checks. However gunzip  is  sometimes<br />       able  to detect a bad .Z file. If you get an error when uncompressing a<br />       .Z file, do not assume that the .Z file is correct simply  because  the<br />       standard  uncompress  does  not complain. This generally means that the<br />       standard uncompress does not check its  input,  and  happily  generates<br />       garbage  output.   The  SCO compress -H format (lzh compression method)<br />       does not include a CRC but also allows some consistency checks.</p>
<p>       Files created by zip can be uncompressed by gzip only if  they  have  a<br />       single  member  compressed with the &#8216;deflation&#8217; method. This feature is<br />       only intended to help conversion of <a>tar.zip</a> files to the <a>tar.gz</a> format.<br />       To  extract  a zip file with a single member, use a command like gunzip<br />       &lt;<a>foo.zip</a> or gunzip -S .zip <a>foo.zip</a>.  To extract zip files with  several<br />       members, use unzip instead of gunzip.</p>
<p>       zcat  is  identical  to  gunzip  -c.   (On  some  systems,  zcat may be<br />       installed as gzcat to preserve the original link  to  compress.)   zcat<br />       uncompresses either a list of files on the command line or its standard<br />       input and writes the uncompressed data on standard output.   zcat  will<br />       uncompress files that have the correct magic number whether they have a<br />       .gz suffix or not.</p>
<p>       Gzip uses the Lempel-Ziv algorithm used in zip and PKZIP.   The  amount<br />       of  compression  obtained depends on the size of the input and the dis-<br />       tribution of common substrings.  Typically, text such as source code or<br />       English  is  reduced  by  60-70%.  Compression is generally much better<br />       than that achieved by LZW (as used in  compress),  Huffman  coding  (as<br />       used in pack), or adaptive Huffman coding (compact).</p>
<p>       Compression  is  always  performed,  even  if  the  compressed  file is<br />       slightly larger than the original. The worst case expansion  is  a  few<br />       bytes  for  the  gzip  file header, plus 5 bytes every 32K block, or an<br />       expansion ratio of 0.015% for large files. Note that the actual  number<br />       of  used  disk blocks almost never increases.  gzip preserves the mode,<br />       ownership and timestamps of files when compressing or decompressing.</p>
<p>       The gzip file format is specified in P. Deutsch, GZIP file format spec-<br />       ification version 4.3, &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1952.txt">ftp://ftp.isi.edu/in-notes/rfc1952.txt</a>&gt;, Inter-<br />       net RFC 1952 (May 1996).  The zip deflation format is specified  in  P.<br />       Deutsch,  DEFLATE  Compressed  Data  Format  Specification version 1.3,<br />       &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1951.txt">ftp://ftp.isi.edu/in-notes/rfc1951.txt</a>&gt;, Internet RFC 1951 (May 1996).</p>
<p>OPTIONS<br />       -a &#8211;ascii<br />              Ascii  text  mode: convert end-of-lines using local conventions.<br />              This option is supported only  on  some  non-Unix  systems.  For<br />              MSDOS, CR LF is converted to LF when compressing, and LF is con-<br />              verted to CR LF when decompressing.</p>
<p>       -c &#8211;stdout &#8211;to-stdout<br />              Write output on standard output; keep original files  unchanged.<br />              If  there  are  several  input  files,  the output consists of a<br />              sequence of independently compressed members. To  obtain  better<br />              compression,  concatenate  all  input  files  before compressing<br />              them.</p>
<p>       -d &#8211;decompress &#8211;uncompress<br />              Decompress.</p>
<p>       -f &#8211;force<br />              Force compression or decompression even if the file has multiple<br />              links  or  the corresponding file already exists, or if the com-<br />              pressed data is read from or written to a terminal. If the input<br />              data  is  not  in a format recognized by gzip, and if the option<br />              &#8211;stdout is also given, copy the input data  without  change  to<br />              the  standard  output:  let  zcat  behave  as cat.  If -f is not<br />              given, and when not running in the background, gzip  prompts  to<br />              verify whether an existing file should be overwritten.</p>
<p>       -h &#8211;help<br />              Display a help screen and quit.</p>
<p>       -l &#8211;list<br />              For each compressed file, list the following fields:</p>
<p>                  compressed size: size of the compressed file<br />                  uncompressed size: size of the uncompressed file<br />                  ratio: compression ratio (0.0% if unknown)<br />                  uncompressed_name: name of the uncompressed file</p>
<p>              The  uncompressed size is given as -1 for files not in gzip for-<br />              mat, such as compressed .Z files. To get the  uncompressed  size<br />              for such a file, you can use:</p>
<p>                  zcat file.Z | wc -c</p>
<p>              In  combination  with the &#8211;verbose option, the following fields<br />              are also displayed:</p>
<p>                  method: compression method<br />                  crc: the 32-bit CRC of the uncompressed data<br />                  date &amp; time: time stamp for the uncompressed file</p>
<p>              The compression methods currently supported  are  deflate,  com-<br />              press,  lzh  (SCO  compress  -H)  and pack.  The crc is given as<br />              ffffffff for a file not in gzip format.</p>
<p>              With &#8211;name, the uncompressed name,  date and  time   are  those<br />              stored within the compress file if present.</p>
<p>              With  &#8211;verbose,  the  size totals and compression ratio for all<br />              files is also displayed, unless some  sizes  are  unknown.  With<br />              &#8211;quiet, the title and totals lines are not displayed.</p>
<p>       -L &#8211;license<br />              Display the gzip license and quit.</p>
<p>       -n &#8211;no-name<br />              When  compressing,  do  not save the original file name and time<br />              stamp by default. (The original name is always saved if the name<br />              had  to  be  truncated.)  When decompressing, do not restore the<br />              original file name if present (remove only the gzip suffix  from<br />              the  compressed  file name) and do not restore the original time<br />              stamp if present (copy it from the compressed file). This option<br />              is the default when decompressing.</p>
<p>       -N &#8211;name<br />              When  compressing,  always  save the original file name and time<br />              stamp; this is the  default.  When  decompressing,  restore  the<br />              original  file  name  and  time stamp if present. This option is<br />              useful on systems which have a limit on file name length or when<br />              the time stamp has been lost after a file transfer.</p>
<p>       -q &#8211;quiet<br />              Suppress all warnings.</p>
<p>       -r &#8211;recursive<br />              Travel  the  directory structure recursively. If any of the file<br />              names specified on the command line are directories,  gzip  will<br />              descend  into  the directory and compress all the files it finds<br />              there (or decompress them in the case of gunzip ).</p>
<p>       -S .suf &#8211;suffix .suf<br />              Use suffix .suf instead of .gz. Any suffix  can  be  given,  but<br />              suffixes other than .z and .gz should be avoided to avoid confu-<br />              sion when files are transferred to other systems.  A null suffix<br />              forces  gunzip  to  try decompression on all given files regard-<br />              less of suffix, as in:</p>
<p>                  gunzip -S &#8220;&#8221; *       (*.* for MSDOS)</p>
<p>              Previous versions of gzip used the .z suffix. This  was  changed<br />              to avoid a conflict with pack(1).</p>
<p>       -t &#8211;test<br />              Test. Check the compressed file integrity.</p>
<p>       -v &#8211;verbose<br />              Verbose. Display the name and percentage reduction for each file<br />              compressed or decompressed.</p>
<p>       -V &#8211;version<br />              Version. Display the version number and compilation options then<br />              quit.</p>
<p>       -# &#8211;fast &#8211;best<br />              Regulate  the  speed of compression using the specified digit #,<br />              where -1 or &#8211;fast  indicates  the  fastest  compression  method<br />              (less  compression)  and -9 or &#8211;best indicates the slowest com-<br />              pression method (best  compression).   The  default  compression<br />              level is -6 (that is, biased towards high compression at expense<br />              of speed).</p>
<p>ADVANCED USAGE<br />       Multiple compressed files can be concatenated.  In  this  case,  gunzip<br />       will extract all members at once. For example:</p>
<p>             gzip -c file1  &gt; <a>foo.gz</a><br />             gzip -c file2 &gt;&gt; <a>foo.gz</a></p>
<p>       Then</p>
<p>             gunzip -c foo</p>
<p>       is equivalent to</p>
<p>             cat file1 file2</p>
<p>       In  case of damage to one member of a .gz file, other members can still<br />       be recovered (if the damaged member is removed). However, you  can  get<br />       better compression by compressing all members at once:</p>
<p>             cat file1 file2 | gzip &gt; <a>foo.gz</a></p>
<p>       compresses better than</p>
<p>             gzip -c file1 file2 &gt; <a>foo.gz</a></p>
<p>       If you want to recompress concatenated files to get better compression,<br />       do:</p>
<p>             gzip -cd <a>old.gz</a> | gzip &gt; <a>new.gz</a></p>
<p>       If a compressed file consists of several members, the uncompressed size<br />       and  CRC reported by the &#8211;list option applies to the last member only.<br />       If you need the uncompressed size for all members, you can use:</p>
<p>             gzip -cd <a>file.gz</a> | wc -c</p>
<p>       If you wish to create a single archive file with  multiple  members  so<br />       that members can later be extracted independently, use an archiver such<br />       as tar or zip. GNU tar supports the -z option to invoke gzip  transpar-<br />       ently. gzip is designed as a complement to tar, not as a replacement.</p>
<p>ENVIRONMENT<br />       The  environment  variable  GZIP  can hold a set of default options for<br />       gzip.  These options are interpreted first and can  be  overwritten  by<br />       explicit command line parameters. For example:<br />             for sh:    GZIP=&#8221;-8v &#8211;name&#8221;; export GZIP<br />             for csh:   setenv GZIP &#8220;-8v &#8211;name&#8221;<br />             for MSDOS: set GZIP=-8v &#8211;name</p>
<p>       On  Vax/VMS, the name of the environment variable is GZIP_OPT, to avoid<br />       a conflict with the symbol set for invocation of the program.</p>
<p>SEE ALSO<br />       znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), com-<br />       press(1), pack(1), compact(1)</p>
<p>       The gzip file format is specified in P. Deutsch, GZIP file format spec-<br />       ification version 4.3, &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1952.txt">ftp://ftp.isi.edu/in-notes/rfc1952.txt</a>&gt;, Inter-<br />       net  RFC  1952 (May 1996).  The zip deflation format is specified in P.<br />       Deutsch, DEFLATE Compressed  Data  Format  Specification  version  1.3,<br />       &lt;<a target="_blank" href="ftp://ftp.isi.edu/in-notes/rfc1951.txt">ftp://ftp.isi.edu/in-notes/rfc1951.txt</a>&gt;, Internet RFC 1951 (May 1996).</p>
<p>DIAGNOSTICS<br />       Exit status is normally 0; if an error occurs, exit status is 1.  If  a<br />       warning occurs, exit status is 2.</p>
<p>       Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]<br />              Invalid options were specified on the command line.</p>
<p>       file: not in gzip format<br />              The file specified to gunzip has not been compressed.</p>
<p>       file: Corrupt input. Use zcat to recover some data.<br />              The  compressed  file has been damaged. The data up to the point<br />              of failure can be recovered using</p>
<p>                    zcat file &gt; recover</p>
<p>       file: compressed with xx bits, can only handle yy bits<br />              File was compressed (using LZW) by a  program  that  could  deal<br />              with more bits than the decompress code on this machine.  Recom-<br />              press the file with gzip, which compresses better and uses  less<br />              memory.</p>
<p>       file: already has .gz suffix &#8212; no change<br />              The  file  is assumed to be already compressed.  Rename the file<br />              and try again.</p>
<p>       file already exists; do you wish to overwrite (y or n)?<br />              Respond &#8220;y&#8221; if you want the output file to be replaced;  &#8220;n&#8221;  if<br />              not.</p>
<p>       gunzip: corrupt input<br />              A  SIGSEGV  violation  was detected which usually means that the<br />              input file has been corrupted.</p>
<p>       xx.x% Percentage of the input saved by compression.<br />              (Relevant only for -v and -l.)</p>
<p>       &#8212; not a regular file or directory: ignored<br />              When the input file is not a regular file or directory, (e.g.  a<br />              symbolic link, socket, FIFO, device file), it is left unaltered.</p>
<p>       &#8212; has xx other links: unchanged<br />              The input file has links; it is left unchanged.  See  ln(1)  for<br />              more information. Use the -f flag to force compression of multi-<br />              ply-linked files.</p>
<p>CAVEATS<br />       When writing compressed data to a tape, it is  generally  necessary  to<br />       pad  the  output  with  zeroes up to a block boundary. When the data is<br />       read and the whole block is passed to gunzip for decompression,  gunzip<br />       detects  that there is extra trailing garbage after the compressed data<br />       and emits a warning by default. You have to use the &#8211;quiet  option  to<br />       suppress  the  warning.  This option can be set in the GZIP environment<br />       variable as in:<br />         for sh:  GZIP=&#8221;-q&#8221;  tar -xfz &#8211;block-compress /dev/rst0<br />         for csh: (setenv GZIP -q; tar -xfz &#8211;block-compr /dev/rst0</p>
<p>       In the above example, gzip is invoked implicitly by the  -z  option  of<br />       GNU  tar. Make sure that the same block size (-b option of tar) is used<br />       for reading and  writing  compressed  data  on  tapes.   (This  example<br />       assumes you are using the GNU version of tar.)</p>
<p>BUGS<br />       The  gzip  format  represents the input size modulo 2^32, so the &#8211;list<br />       option reports incorrect uncompressed sizes and compression ratios  for<br />       uncompressed  files  4 GB and larger.  To work around this problem, you<br />       can use the following command to discover a large  uncompressed  file&#8217;s<br />       true size:</p>
<p>             zcat <a>file.gz</a> | wc -c</p>
<p>       The  &#8211;list  option reports sizes as -1 and crc as ffffffff if the com-<br />       pressed file is on a non seekable media.</p>
<p>       In some rare cases, the &#8211;best option gives worse compression than  the<br />       default  compression  level  (-6). On some highly redundant files, com-<br />       press compresses better than gzip.</p>
<p>COPYRIGHT NOTICE<br />       Copyright Â© 1998, 1999, 2001, 2002 Free Software Foundation, Inc.<br />       Copyright Â© 1992, 1993 Jean-loup Gailly</p>
<p>       Permission is granted to make and distribute verbatim  copies  of  this<br />       manual  provided  the  copyright  notice and this permission notice are<br />       preserved on all copies.</p>
<p>       Permission is granted to copy and distribute modified versions of  this<br />       manual  under  the  conditions  for verbatim copying, provided that the<br />       entire resulting derived work is distributed under the terms of a  per-<br />       mission notice identical to this one.</p>
<p>       Permission  is granted to copy and distribute translations of this man-<br />       ual into another language, under the above conditions for modified ver-<br />       sions,  except  that this permission notice may be stated in a transla-<br />       tion approved by the Foundation.</p>
<p>                                     local                             GZIP(1)</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=9508e3d0-e643-4356-ae53-c34108794a18" /></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/GZIP' rel='tag' target='_self'>GZIP</a>, <a class='technorati-link' href='http://technorati.com/tag/Linux+Man+Pages' rel='tag' target='_self'>Linux Man Pages</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip/" title="GZIP">GZIP</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/gzip-2/" title="GZIP">GZIP</a></li><li>January 4, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/04/sort/" title="SORT">SORT</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/mkdirhier/" title="MKDIRHIER">MKDIRHIER</a></li><li>January 1, 2009 -- <a href="http://itechlog.com/linux-man-pages/2009/01/01/modinfo/" title="MODINFO">MODINFO</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/linux-man-pages/2009/01/01/gzip-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

