gzip 4.6 KB

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