gzip 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. .TH GZIP 1
  2. .SH NAME
  3. gzip, gunzip, bzip2, bunzip2, compress, uncompress, zip, unzip \- compress and expand data
  4. .SH SYNOPSIS
  5. .B gzip
  6. .RB [ -cvD [ 1-9 ]]
  7. .RI [ file
  8. .BR ... ]
  9. .PP
  10. .B gunzip
  11. .RB [ -ctTvD ]
  12. .RI [ file
  13. .BR ... ]
  14. .PP
  15. .B bzip2
  16. .RB [ -cvD [ 1-9 ]]
  17. .RI [ file
  18. .BR ... ]
  19. .PP
  20. .B bunzip2
  21. .RB [ -cvD ]
  22. .RI [ file
  23. .BR ... ]
  24. .PP
  25. .B compress
  26. [
  27. .B -cv
  28. ] [
  29. .I file
  30. .B ...
  31. ]
  32. .PP
  33. .B uncompress
  34. [
  35. .B -cv
  36. ] [
  37. .I file
  38. .B ...
  39. ]
  40. .PP
  41. .B zip
  42. .RB [ -avD [ 1-9 ]]
  43. .RB [ -f
  44. .IR zipfile ]
  45. .I file
  46. .RB [ ... ]
  47. .PP
  48. .B unzip
  49. .RB [ -cistTvD ]
  50. .RB [ -f
  51. .IR zipfile ]
  52. .RI [ file
  53. .BR ... ]
  54. .SH DESCRIPTION
  55. .PP
  56. .I Gzip
  57. encodes files with a hybrid Lempel-Ziv 1977 and Huffman compression algorithm
  58. known as
  59. .BR deflate .
  60. Most of the time, the resulting file is smaller,
  61. and will never be much bigger.
  62. Output files are named by taking the last path element of each file argument
  63. and appending
  64. .BR .gz ;
  65. if the resulting name ends with
  66. .BR .tar.gz ,
  67. it is converted to
  68. .B .tgz
  69. instead.
  70. .I Gunzip
  71. reverses the process.
  72. Its output files are named by taking the last path element of each file argument,
  73. converting
  74. .B .tgz
  75. to
  76. .BR .tar.gz ,
  77. and stripping any
  78. .BR .gz ;
  79. the resulting name must be different from the original name.
  80. .PP
  81. .I Bzip2
  82. and
  83. .I bunzip2
  84. are similar in interface to
  85. .I gzip
  86. and
  87. .IR gunzip ,
  88. but use a modified Burrows-Wheeler block sorting
  89. compression algorithm.
  90. The default suffix for output files is
  91. .BR .bz2 ,
  92. with
  93. .B .tar.bz2
  94. becoming
  95. .BR .tbz .
  96. .I Bunzip2
  97. recognizes the extension
  98. .B .tbz2
  99. as a synonym for
  100. .BR .tbz .
  101. .PP
  102. .I Compress
  103. and
  104. .I uncompress
  105. are similar in interface to
  106. .I gzip
  107. and
  108. .IR gunzip ,
  109. but use the Lempel-Ziv-Welch compression algorithm.
  110. The default suffix for output files is
  111. .BR .Z .
  112. .I Compress
  113. is one of the oldest widespread Unix compression programs.
  114. .PP
  115. .I Zip
  116. encodes the named files and places the results into the archive
  117. .IR zipfile ,
  118. or the standard output if no file is given.
  119. .I Unzip
  120. extracts files from an archive created by
  121. .IR zip .
  122. If no files are named as arguments, all of files in the archive are extracted.
  123. A directory's name implies all recursively contained files and subdirectories.
  124. .I Zip
  125. is the
  126. .I "de facto"
  127. standard for compression on Microsoft operating systems.
  128. .PP
  129. None of these programs removes the original files.
  130. If the process fails, the faulty output files are removed.
  131. .PP
  132. The options are:
  133. .TP 0.6i
  134. .B -a
  135. Automaticialy creates directories as needed, needed for zip files
  136. created by broken implementations which omit directories.
  137. .TP
  138. .B -c
  139. Write to standard output rather than creating an output file.
  140. .TP
  141. .B -i
  142. Convert all archive file names to lower case.
  143. .TP
  144. .B -s
  145. Streaming mode. Looks at the file data adjacent to each compressed file
  146. rather than seeking in the central file directory.
  147. This is the mode used by
  148. .I unzip
  149. if no
  150. .I zipfile
  151. is specified.
  152. If
  153. .B -s
  154. is given,
  155. .B -T
  156. is ignored.
  157. .TP
  158. .B -t
  159. List matching files in the archive rather than extracting them.
  160. .TP
  161. .B -T
  162. Set the output time to that specified in the archive.
  163. .TP
  164. .BR -1 " .. " -9
  165. Sets the compression level.
  166. .B -1
  167. is tuned for speed,
  168. .B -9
  169. for minimal output size.
  170. The best compromise is
  171. .BR -6 ,
  172. the default.
  173. .TP
  174. .B -v
  175. Produce more descriptive output.
  176. With
  177. .BR -t ,
  178. adds the uncompressed size in bytes and the modification time to the output.
  179. Without
  180. .BR -t ,
  181. prints the names of files on standard error as they are compressed or decompressed.
  182. .TP
  183. .B -D
  184. Produce debugging output.
  185. .SH SOURCE
  186. .B /sys/src/cmd/gzip
  187. .br
  188. .B /sys/src/cmd/bzip2
  189. .br
  190. .B /sys/src/cmd/compress
  191. .SH SEE ALSO
  192. .IR tar (1)
  193. .br
  194. "A Technique for High Performance Data Compression",
  195. Terry A. Welch,
  196. .IR "IEEE Computer" ,
  197. vol. 17, no. 6 (June 1984), pp. 8-19.
  198. .SH BUGS
  199. .I Unzip
  200. can only extract files which are uncompressed or compressed
  201. with the
  202. .B deflate
  203. compression scheme. Recent zip files fall into this category.
  204. Very recent zip files may have tables of contents that
  205. .I unzip
  206. cannot read. Such files are still readable by invoking
  207. .I unzip
  208. with the
  209. .B -s
  210. option.