Print this page
12284 errors in compress(1) and pack(1) man pages


  27 .\" The contents of this file are subject to the terms of the
  28 .\" Common Development and Distribution License (the "License").
  29 .\" You may not use this file except in compliance with the License.
  30 .\"
  31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Copyright 1989 AT&T
  44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
  45 .\" Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved
  46 .\"
  47 .TH COMPRESS 1 "Mar 13, 2008"
  48 .SH NAME
  49 compress, uncompress, zcat \- compress, uncompress files or display expanded
  50 files
  51 .SH SYNOPSIS
  52 .LP
  53 .nf
  54 \fBcompress\fR [\fB-fv/\fR] [\fB-b\fR \fIbits\fR] [\fIfile\fR]...
  55 .fi
  56 
  57 .LP
  58 .nf
  59 \fBcompress\fR \fB-c\fR [\fB-fv\fR] [\fB-b\fR \fIbits\fR] [\fIfile\fR]
  60 .fi
  61 
  62 .LP
  63 .nf
  64 \fBuncompress\fR [\fB-fv\fR] [\fB-c | -/\fR] [\fIfile\fR]...
  65 .fi
  66 
  67 .LP
  68 .nf
  69 \fBzcat\fR [\fIfile\fR]...
  70 .fi
  71 
  72 .SH DESCRIPTION
  73 .SS "compress"
  74 .sp
  75 .LP
  76 The \fBcompress\fR utility attempts to reduce the size of the named files by
  77 using adaptive Lempel-Ziv coding. Except when the output is to the standard
  78 output, each file is replaced by one with the extension \fB\&.Z\fR, while
  79 keeping the same ownership modes, change times and modification times, ACLs,
  80 and extended attributes. The compress utility also attempt to set the owner and
  81 group of \fIfile\fR\fB\&.z\fR to the owner and group of file, but does not fail
  82 if this cannot be done. If appending the \fB\&.Z\fR to the file pathname would
  83 make the pathname exceed \fB1023\fR bytes, the command fails. If no files are
  84 specified, the standard input is compressed to the standard output.
  85 .sp
  86 .LP
  87 The amount of compression obtained depends on the size of the input, the number
  88 of \fIbits\fR per code, and the distribution of common substrings. Typically,
  89 text such as source code or English is reduced by 50\(mi60%. Compression is
  90 generally much better than that achieved by Huffman coding (as used in
  91 \fBpack\fR(1)) and it takes less time to compute. The \fIbits\fR parameter
  92 specified during compression is encoded within the compressed file, along with
  93 a magic number to ensure that neither decompression of random data nor
  94 recompression of compressed data is subsequently allowed.
  95 .SS "uncompress"
  96 .sp
  97 .LP
  98 The \fBuncompress\fR utility restores files to their original state after they
  99 have been compressed using the \fBcompress\fR utility. If no files are
 100 specified, the standard input is uncompressed to the standard output.
 101 .sp
 102 .LP
 103 This utility supports the uncompressing of any files produced by
 104 \fBcompress\fR. For files produced by \fBcompress\fR on other systems,
 105 \fBuncompress\fR supports 9- to 16-bit compression (see \fB-b\fR).
 106 .SS "zcat"
 107 .sp
 108 .LP
 109 The \fBzcat\fR utility writes to standard output the uncompressed form of files
 110 that have been compressed using \fBcompress\fR. It is the equivalent of
 111 \fBuncompress\fR\fB-c\fR. Input files are not affected.
 112 .SH OPTIONS
 113 .sp
 114 .LP
 115 The following options are supported:
 116 .sp
 117 .ne 2
 118 .na
 119 \fB\fB-b\fR \fIbits\fR\fR
 120 .ad
 121 .RS 11n
 122 Sets the upper limit (in bits) for common substring codes. \fIbits\fR must be
 123 between 9 and 16 (16 is the default). Lowering the number of bits result in
 124 larger, less compressed files.
 125 .RE
 126 
 127 .sp
 128 .ne 2
 129 .na
 130 \fB\fB-c\fR\fR
 131 .ad
 132 .RS 11n
 133 Writes to the standard output; no files are changed and no \fB\&.Z\fR files are
 134 created. The behavior of \fBzcat\fR is identical to that of `\fBuncompress\fR


 164 Verbose. Writes to standard error messages concerning the percentage reduction
 165 or expansion of each file.
 166 .RE
 167 
 168 .sp
 169 .ne 2
 170 .na
 171 \fB\fB-/\fR\fR
 172 .ad
 173 .RS 11n
 174 When compressing or decompressing, copies any extended system attributes
 175 associated with the source file to the target file and copies any extended
 176 system attributes associated with extended attributes of the source file to the
 177 corresponding extended attributes associated with the target file. If any
 178 extended system attributes cannot be copied, the original file is retained, a
 179 diagnostic is written to \fBstderr\fR, and the final exit status is
 180 \fBnon-zero\fR.
 181 .RE
 182 
 183 .SH OPERANDS
 184 .sp
 185 .LP
 186 The following operand is supported:
 187 .sp
 188 .ne 2
 189 .na
 190 \fB\fIfile\fR\fR
 191 .ad
 192 .RS 8n
 193 A path name of a file to be compressed by \fBcompress\fR, uncompressed by
 194 \fBuncompress\fR, or whose uncompressed form is written to standard out by
 195 \fBzcat\fR. If \fIfile\fR is \fB\(mi\fR, or if no \fIfile\fR is specified, the
 196 standard input is used.
 197 .RE
 198 
 199 .SH USAGE
 200 .sp
 201 .LP
 202 See \fBlargefile\fR(5) for the description of the behavior of \fBcompress\fR,
 203 \fBuncompress\fR, and \fBzcat\fR when encountering files greater than or equal
 204 to 2 Gbyte ( 2^31 bytes).
 205 .SH ENVIRONMENT VARIABLES
 206 .sp
 207 .LP
 208 See \fBenviron\fR(5) for descriptions of the following environment variables
 209 that affect the execution of \fBcompress\fR, \fBuncompress\fR, and \fBzcat\fR:
 210 \fBLANG\fR, \fBLC_ALL\fR, \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
 211 and \fBNLSPATH\fR.
 212 .sp
 213 .LP
 214 Affirmative responses are processed using the extended regular expression
 215 defined for the \fByesexpr\fR keyword in the \fBLC_MESSAGES\fR category of the
 216 user's locale. The locale specified in the \fBLC_COLLATE\fR category defines
 217 the behavior of ranges, equivalence classes, and multi-character collating
 218 elements used in the expression defined for \fByesexpr\fR. The locale specified
 219 in \fBLC_CTYPE\fR determines the locale for interpretation of sequences of
 220 bytes of text data a characters, the behavior of character classes used in the
 221 expression defined for the \fByesexpr\fR. See \fBlocale\fR(5).
 222 .SH EXIT STATUS
 223 .sp
 224 .LP
 225 The following error values are returned:
 226 .sp
 227 .ne 2
 228 .na
 229 \fB\fB0\fR\fR
 230 .ad
 231 .RS 6n
 232 Successful completion.
 233 .RE
 234 
 235 .sp
 236 .ne 2
 237 .na
 238 \fB\fB1\fR\fR
 239 .ad
 240 .RS 6n
 241 An error occurred.
 242 .RE
 243 
 244 .sp
 245 .ne 2
 246 .na
 247 \fB\fB2\fR\fR
 248 .ad
 249 .RS 6n
 250 One or more files were not compressed because they would have increased in size
 251 (and the \fB-f\fR option was not specified).
 252 .RE
 253 
 254 .sp
 255 .ne 2
 256 .na
 257 \fB\fB>2\fR\fR
 258 .ad
 259 .RS 6n
 260 An error occurred.
 261 .RE
 262 
 263 .SH ATTRIBUTES
 264 .sp
 265 .LP
 266 See \fBattributes\fR(5) for descriptions of the following attributes:
 267 .sp
 268 
 269 .sp
 270 .TS
 271 box;
 272 c | c
 273 l | l .
 274 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 275 _
 276 CSI     Enabled
 277 _
 278 Interface Stability     Committed
 279 _
 280 Standard        See \fBstandards\fR(5).
 281 .TE
 282 
 283 .SH SEE ALSO
 284 .sp
 285 .LP
 286 \fBln\fR(1), \fBpack\fR(1), \fBfgetattr\fR(3C), \fBfsetattr\fR(3C),
 287 \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBlocale\fR(5),
 288 \fBstandards\fR(5)
 289 .SH DIAGNOSTICS
 290 .sp
 291 .ne 2
 292 .na
 293 \fBUsage: \fBcompress [-fv/] [-b\fR \fIbits\fR] [\fIfile\fR\|.\|.\|. ]\fR
 294 .ad
 295 .br
 296 .na
 297 \fB\fBcompress c [-fv] [-b\fR \fIbits\fR] [\fIfile\fR\|.\|.\|. ]\fR
 298 .ad
 299 .sp .6
 300 .RS 4n
 301 Invalid options were specified on the command line.
 302 .RE
 303 
 304 .sp
 305 .ne 2
 306 .na
 307 \fBUsage: \fBuncompress [-fv] [-c | -/] [\fR\fIfile\fR\fB]...\fR\fR
 308 .ad
 309 .sp .6
 310 .RS 4n
 311 Invalid options were specified on the command line.
 312 .RE
 313 
 314 .sp
 315 .ne 2
 316 .na
 317 \fBMissing maxbits\fR


 339 .sp .6
 340 .RS 4n
 341 \fBfile\fR was compressed by a program that could deal with more \fIbits\fR
 342 than the compress code on this machine. Recompress the file with smaller
 343 \fIbits\fR.
 344 .RE
 345 
 346 .sp
 347 .ne 2
 348 .na
 349 \fB\fIfile\fR: already has .\|Z suffix -- no change\fR
 350 .ad
 351 .sp .6
 352 .RS 4n
 353 The file is assumed to be already compressed. Rename the file and try again.
 354 .RE
 355 
 356 .sp
 357 .ne 2
 358 .na
 359 \fB\fIfile\fR: already exists; do you wish to overwrite (y or n)?\fR
 360 .ad
 361 .sp .6
 362 .RS 4n
 363 Respond \fBy\fR if you want the output file to be replaced; \fBn\fR if not.
 364 .RE
 365 
 366 .sp
 367 .ne 2
 368 .na
 369 \fBuncompress: corrupt input\fR
 370 .ad
 371 .sp .6
 372 .RS 4n
 373 A \fBSIGSEGV\fR violation was detected, which usually means that the input file
 374 is corrupted.
 375 .RE
 376 
 377 .sp
 378 .ne 2
 379 .na


 420 .ne 2
 421 .na
 422 \fB- -filename too long to tack on .Z\fR
 423 .ad
 424 .sp .6
 425 .RS 4n
 426 The path name is too long to append the \fB\&.Z\fR suffix.
 427 .RE
 428 
 429 .sp
 430 .ne 2
 431 .na
 432 \fB- -cannot preserve extended attributes. file unchanged\fR
 433 .ad
 434 .sp .6
 435 .RS 4n
 436 Extended system attributes could not be copied.
 437 .RE
 438 
 439 .SH NOTES
 440 .sp
 441 .LP
 442 Although compressed files are compatible between machines with large memory,
 443 \fB-b\fR 12 should be used for file transfer to architectures with a small
 444 process data space (64KB or less).
 445 .sp
 446 .LP
 447 \fBcompress\fR should be more flexible about the existence of the \fB\&.\|Z\fR
 448 suffix.


  27 .\" The contents of this file are subject to the terms of the
  28 .\" Common Development and Distribution License (the "License").
  29 .\" You may not use this file except in compliance with the License.
  30 .\"
  31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  32 .\" or http://www.opensolaris.org/os/licensing.
  33 .\" See the License for the specific language governing permissions
  34 .\" and limitations under the License.
  35 .\"
  36 .\" When distributing Covered Code, include this CDDL HEADER in each
  37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  38 .\" If applicable, add the following below this CDDL HEADER, with the
  39 .\" fields enclosed by brackets "[]" replaced with your own identifying
  40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
  41 .\"
  42 .\"
  43 .\" Copyright 1989 AT&T
  44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
  45 .\" Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved
  46 .\"
  47 .TH COMPRESS 1 "Feb 5, 2020"
  48 .SH NAME
  49 compress, uncompress, zcat \- compress, uncompress files or display expanded
  50 files
  51 .SH SYNOPSIS

  52 .nf
  53 \fBcompress\fR [\fB-fv/\fR] [\fB-b\fR \fIbits\fR] [\fIfile\fR]...
  54 .fi
  55 
  56 .LP
  57 .nf
  58 \fBcompress\fR \fB-c\fR [\fB-fv\fR] [\fB-b\fR \fIbits\fR] [\fIfile\fR]
  59 .fi
  60 
  61 .LP
  62 .nf
  63 \fBuncompress\fR [\fB-fv\fR] [\fB-c | -/\fR] [\fIfile\fR]...
  64 .fi
  65 
  66 .LP
  67 .nf
  68 \fBzcat\fR [\fIfile\fR]...
  69 .fi
  70 
  71 .SH DESCRIPTION
  72 .SS "compress"


  73 The \fBcompress\fR utility attempts to reduce the size of the named files by
  74 using adaptive Lempel-Ziv coding. Except when the output is to the standard
  75 output, each file is replaced by one with the extension \fB\&.Z\fR, while
  76 keeping the same ownership modes, change times and modification times, ACLs,
  77 and extended attributes. The compress utility also attempts to set the owner and
  78 group of \fIfile\fR\fB\&.Z\fR to the owner and group of file, but does not fail
  79 if this cannot be done. If appending the \fB\&.Z\fR to the file pathname would
  80 make the pathname exceed \fB1023\fR bytes, the command fails. If no files are
  81 specified, the standard input is compressed to the standard output.
  82 .sp
  83 .LP
  84 The amount of compression obtained depends on the size of the input, the number
  85 of \fIbits\fR per code, and the distribution of common substrings. Typically,
  86 text such as source code or English is reduced by 50\(mi60%. Compression is
  87 generally much better than that achieved by Huffman coding (as used in
  88 \fBpack\fR(1)) and it takes less time to compute. The \fIbits\fR parameter
  89 specified during compression is encoded within the compressed file, along with
  90 a magic number to ensure that neither decompression of random data nor
  91 recompression of compressed data is subsequently allowed.
  92 .SS "uncompress"


  93 The \fBuncompress\fR utility restores files to their original state after they
  94 have been compressed using the \fBcompress\fR utility. If no files are
  95 specified, the standard input is uncompressed to the standard output.
  96 .sp
  97 .LP
  98 This utility supports the uncompressing of any files produced by
  99 \fBcompress\fR. For files produced by \fBcompress\fR on other systems,
 100 \fBuncompress\fR supports 9- to 16-bit compression (see \fB-b\fR).
 101 .SS "zcat"


 102 The \fBzcat\fR utility writes to standard output the uncompressed form of files
 103 that have been compressed using \fBcompress\fR. It is the equivalent of
 104 \fBuncompress\fR \fB-c\fR. Input files are not affected.
 105 .SH OPTIONS


 106 The following options are supported:
 107 .sp
 108 .ne 2
 109 .na
 110 \fB\fB-b\fR \fIbits\fR\fR
 111 .ad
 112 .RS 11n
 113 Sets the upper limit (in bits) for common substring codes. \fIbits\fR must be
 114 between 9 and 16 (16 is the default). Lowering the number of bits result in
 115 larger, less compressed files.
 116 .RE
 117 
 118 .sp
 119 .ne 2
 120 .na
 121 \fB\fB-c\fR\fR
 122 .ad
 123 .RS 11n
 124 Writes to the standard output; no files are changed and no \fB\&.Z\fR files are
 125 created. The behavior of \fBzcat\fR is identical to that of `\fBuncompress\fR


 155 Verbose. Writes to standard error messages concerning the percentage reduction
 156 or expansion of each file.
 157 .RE
 158 
 159 .sp
 160 .ne 2
 161 .na
 162 \fB\fB-/\fR\fR
 163 .ad
 164 .RS 11n
 165 When compressing or decompressing, copies any extended system attributes
 166 associated with the source file to the target file and copies any extended
 167 system attributes associated with extended attributes of the source file to the
 168 corresponding extended attributes associated with the target file. If any
 169 extended system attributes cannot be copied, the original file is retained, a
 170 diagnostic is written to \fBstderr\fR, and the final exit status is
 171 \fBnon-zero\fR.
 172 .RE
 173 
 174 .SH OPERANDS


 175 The following operand is supported:
 176 .sp
 177 .ne 2
 178 .na
 179 \fB\fIfile\fR\fR
 180 .ad
 181 .RS 8n
 182 A path name of a file to be compressed by \fBcompress\fR, uncompressed by
 183 \fBuncompress\fR, or whose uncompressed form is written to standard out by
 184 \fBzcat\fR. If \fIfile\fR is \fB\(mi\fR, or if no \fIfile\fR is specified, the
 185 standard input is used.
 186 .RE
 187 
 188 .SH USAGE


 189 See \fBlargefile\fR(5) for the description of the behavior of \fBcompress\fR,
 190 \fBuncompress\fR, and \fBzcat\fR when encountering files greater than or equal
 191 to 2 Gbyte (2^31 bytes).
 192 .SH ENVIRONMENT VARIABLES


 193 See \fBenviron\fR(5) for descriptions of the following environment variables
 194 that affect the execution of \fBcompress\fR, \fBuncompress\fR, and \fBzcat\fR:
 195 \fBLANG\fR, \fBLC_ALL\fR, \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
 196 and \fBNLSPATH\fR.
 197 .sp
 198 .LP
 199 Affirmative responses are processed using the extended regular expression
 200 defined for the \fByesexpr\fR keyword in the \fBLC_MESSAGES\fR category of the
 201 user's locale. The locale specified in the \fBLC_COLLATE\fR category defines
 202 the behavior of ranges, equivalence classes, and multi-character collating
 203 elements used in the expression defined for \fByesexpr\fR. The locale specified
 204 in \fBLC_CTYPE\fR determines the locale for interpretation of sequences of
 205 bytes of text data a characters, the behavior of character classes used in the
 206 expression defined for the \fByesexpr\fR. See \fBlocale\fR(5).
 207 .SH EXIT STATUS


 208 The following error values are returned:
 209 .sp
 210 .ne 2
 211 .na
 212 \fB\fB0\fR\fR
 213 .ad
 214 .RS 6n
 215 Successful completion.
 216 .RE
 217 
 218 .sp
 219 .ne 2
 220 .na
 221 \fB\fB1\fR\fR
 222 .ad
 223 .RS 6n
 224 An error occurred.
 225 .RE
 226 
 227 .sp
 228 .ne 2
 229 .na
 230 \fB\fB2\fR\fR
 231 .ad
 232 .RS 6n
 233 One or more files were not compressed because they would have increased in size
 234 (and the \fB-f\fR option was not specified).
 235 .RE
 236 
 237 .sp
 238 .ne 2
 239 .na
 240 \fB\fB>2\fR\fR
 241 .ad
 242 .RS 6n
 243 An error occurred.
 244 .RE
 245 
 246 .SH ATTRIBUTES


 247 See \fBattributes\fR(5) for descriptions of the following attributes:
 248 .sp
 249 
 250 .sp
 251 .TS
 252 box;
 253 c | c
 254 l | l .
 255 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 256 _
 257 CSI     Enabled
 258 _
 259 Interface Stability     Committed
 260 _
 261 Standard        See \fBstandards\fR(5).
 262 .TE
 263 
 264 .SH SEE ALSO


 265 \fBln\fR(1), \fBpack\fR(1), \fBfgetattr\fR(3C), \fBfsetattr\fR(3C),
 266 \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBlocale\fR(5),
 267 \fBstandards\fR(5)
 268 .SH DIAGNOSTICS

 269 .ne 2
 270 .na
 271 \fBUsage: \fBcompress [-fv/] [-b\fR \fImaxbits\fR\fB]\fR [\fIfile\fR\|.\|.\|. ]\fR
 272 .ad
 273 .br
 274 .na
 275 \fB\fBcompress c [-fv] [-b\fR \fImaxbits\fR\fB]\fR [\fIfile\fR]\fR
 276 .ad
 277 .sp .6
 278 .RS 4n
 279 Invalid options were specified on the command line.
 280 .RE
 281 
 282 .sp
 283 .ne 2
 284 .na
 285 \fBUsage: \fBuncompress [-fv] [-c | -/] [\fR\fIfile\fR\fB]...\fR\fR
 286 .ad
 287 .sp .6
 288 .RS 4n
 289 Invalid options were specified on the command line.
 290 .RE
 291 
 292 .sp
 293 .ne 2
 294 .na
 295 \fBMissing maxbits\fR


 317 .sp .6
 318 .RS 4n
 319 \fBfile\fR was compressed by a program that could deal with more \fIbits\fR
 320 than the compress code on this machine. Recompress the file with smaller
 321 \fIbits\fR.
 322 .RE
 323 
 324 .sp
 325 .ne 2
 326 .na
 327 \fB\fIfile\fR: already has .\|Z suffix -- no change\fR
 328 .ad
 329 .sp .6
 330 .RS 4n
 331 The file is assumed to be already compressed. Rename the file and try again.
 332 .RE
 333 
 334 .sp
 335 .ne 2
 336 .na
 337 \fB\fIfile\fR already exists; do you wish to overwrite (yes or no)?\fR
 338 .ad
 339 .sp .6
 340 .RS 4n
 341 Respond \fBy\fR if you want the output file to be replaced; \fBn\fR if not.
 342 .RE
 343 
 344 .sp
 345 .ne 2
 346 .na
 347 \fBuncompress: corrupt input\fR
 348 .ad
 349 .sp .6
 350 .RS 4n
 351 A \fBSIGSEGV\fR violation was detected, which usually means that the input file
 352 is corrupted.
 353 .RE
 354 
 355 .sp
 356 .ne 2
 357 .na


 398 .ne 2
 399 .na
 400 \fB- -filename too long to tack on .Z\fR
 401 .ad
 402 .sp .6
 403 .RS 4n
 404 The path name is too long to append the \fB\&.Z\fR suffix.
 405 .RE
 406 
 407 .sp
 408 .ne 2
 409 .na
 410 \fB- -cannot preserve extended attributes. file unchanged\fR
 411 .ad
 412 .sp .6
 413 .RS 4n
 414 Extended system attributes could not be copied.
 415 .RE
 416 
 417 .SH NOTES


 418 Although compressed files are compatible between machines with large memory,
 419 \fB-b\fR 12 should be used for file transfer to architectures with a small
 420 process data space (64KB or less).
 421 .sp
 422 .LP
 423 \fBcompress\fR should be more flexible about the existence of the \fB\&.\|Z\fR
 424 suffix.