1COMPRESS(1) 386BSD Reference Manual COMPRESS(1) 2 3NNAAMMEE 4 ccoommpprreessss, uunnccoommpprreessss, zzccaatt - compress and expand data 5 6SSYYNNOOPPSSIISS 7 ccoommpprreessss [--ff] [--vv] [--cc] [--bb _b_i_t_s] [_f_i_l_e ...] 8 uunnccoommpprreessss [--ff] [--vv] [--cc] _f_i_l_e ... 9 zzccaatt [_f_i_l_e ...] 10 11DDEESSCCRRIIPPTTIIOONN 12 CCoommpprreessss reduces the size of the named files using adaptive Lempel-Ziv 13 coding. Whenever possible, each _f_i_l_e is replaced by one with the 14 extension ._Z, while keeping the same ownership modes, access and 15 modification times. If no files are specified, the standard input is 16 compressed to the standard output. Compressed files can be restored to 17 their original form using uunnccoommpprreessss or zzccaatt 18 19 --ff Force compression of _f_i_l_e, even if it does not actually shrink or 20 the corresponding _f_i_l_e._Z file already exists. Except when run in 21 the background under /_b_i_n/_s_h, if --ff is not given the user is 22 prompted as to whether an existing _f_i_l_e._Z file should be 23 overwritten. 24 25 --cc (``cat''). CCoommpprreessss//uunnccoommpprreessss writes to the standard output; no 26 files are changed. The nondestructive behavior of zzccaatt is 27 identical to that of uunnccoommpprreessss --cc. 28 29 --bb Specify _b_i_t_s code limit (see below). 30 31 --vv Print the percentage reduction of each file. 32 33 CCoommpprreessss uses the modified Lempel-Ziv algorithm popularized in "A 34 Technique for High Performance Data Compression", Terry A. Welch, _I_E_E_E 35 _C_o_m_p_u_t_e_r, vol. 17, (June 1984), pp. 8-19. Common substrings in the file 36 are first replaced by 9-bit codes 257 and up. When code 512 is reached, 37 the algorithm switches to 10-bit codes and continues to use more bits 38 until the limit specified by the --bb flag is reached (default 16). _B_i_t_s 39 must be between 9 and 16. The default can be changed in the source to 40 allow ccoommpprreessss to be run on a smaller machine. 41 42 After the _b_i_t_s limit is attained, ccoommpprreessss periodically checks the 43 compression ratio. If it is increasing, ccoommpprreessss continues to use the 44 existing code dictionary. However, if the compression ratio decreases, 45 ccoommpprreessss discards the table of substrings and rebuilds it from scratch. 46 This allows the algorithm to adapt to the next "block" of the file. 47 48 Note that the --bb flag is omitted for _u_n_c_o_m_p_r_e_s_s since the _b_i_t_s parameter 49 specified during compression is encoded within the output, along with a 50 magic number to ensure that neither decompression of random data nor 51 recompression of compressed data is attempted. 52 53 The amount of compression obtained depends on the size of the input, the 54 number of _b_i_t_s per code, and the distribution of common substrings. 55 Typically, text such as source code or English is reduced by 50-60%. 56 Compression is generally much better than that achieved by Huffman coding 57 (as used in the historical command pack), or adaptive Huffman coding (as 58 used in the historical command compact), and takes less time to compute. 59 60 If an error occurs, exit status is 1; if the last file was not compressed 61 because it became larger, the status is 2; otherwise the status is 0. 62 63DDIIAAGGNNOOSSTTIICCSS 64 65 66 67 Usage: compress [-fvc] [-b maxbits] [file ...] 68 Invalid options were specified on the command line. 69 70 Missing maxbits 71 Maxbits must follow --bb. 72 73 _f_i_l_e: not in compressed format 74 The file specified to _u_n_c_o_m_p_r_e_s_s has not been compressed. 75 76 _f_i_l_e: compressed with _x_x bits, can only handle _y_y bits 77 _F_i_l_e was compressed by a program that could deal with more _b_i_t_s 78 than the compress code on this machine. Recompress the file with 79 smaller _b_i_t_s. 80 81 _f_i_l_e: already has .Z suffix -- no change 82 The file is assumed to be already compressed. Rename the file and 83 try again. 84 85 _f_i_l_e: filename too long to tack on .Z 86 The file cannot be compressed because its name is longer than 12 87 characters. Rename and try again. This message does not occur on 88 BSD UNIX systems. 89 90 _f_i_l_e already exists; do you wish to overwrite (y or n)? 91 Respond "y" if you want the output file to be replaced; "n" if not. 92 93 uncompress: corrupt input 94 A SIGSEGV violation was detected which usually means that the input 95 file is corrupted. 96 97 Compression: _x_x._x_x% 98 Percentage of the input saved by compression. (Relevant only for 99 --vv.) 100 101 -- not a regular file: unchanged 102 When the input file is not a regular file, (e.g. a directory), it 103 is left unaltered. 104 105 -- has _x_x other links: unchanged 106 The input file has links; it is left unchanged. See ln(1) for more 107 information. 108 109 -- file unchanged 110 No savings is achieved by compression. The input remains virgin. 111 112FFIILLEESS 113 file.Z compressed file is file.Z 114 115BBUUGGSS 116 Although compressed files are compatible between machines with large 117 memory, --bb_1_2 should be used for file transfer to architectures with a 118 small process data space (64KB or less, as exhibited by the DEC PDP 119 series, the Intel 80286, etc.) 120 121 CCoommpprreessss should be more flexible about the existence of the `.Z' suffix. 122 123HHIISSTTOORRYY 124 The ccoommpprreessss command appeared in 4.3BSD. 125 1264.3 Berkeley Distribution July 30, 1991 2 127 128 129 130 131 132 133