1 | .\" -*- indent-tabs-mode: nil -*- |
---|
2 | .\" |
---|
3 | .\" Copyright (c) 2008 Koji Arai |
---|
4 | .\" |
---|
5 | .\" Permission is hereby granted, free of charge, to any person |
---|
6 | .\" obtaining a copy of this software and associated documentation files |
---|
7 | .\" (the "Software"), to deal in the Software without restriction, |
---|
8 | .\" including without limitation the rights to use, copy, modify, merge, |
---|
9 | .\" publish, distribute, sublicense, and/or sell copies of the Software, |
---|
10 | .\" and to permit persons to whom the Software is furnished to do so, |
---|
11 | .\" subject to the following conditions: |
---|
12 | .\" |
---|
13 | .\" The above copyright notice and this permission notice shall be |
---|
14 | .\" included in all copies or substantial portions of the Software. |
---|
15 | .\" |
---|
16 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
---|
17 | .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
---|
18 | .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
---|
19 | .\" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
---|
20 | .\" BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
---|
21 | .\" ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
---|
22 | .\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
---|
23 | .\" SOFTWARE. |
---|
24 | |
---|
25 | .TH LHA "1" "February 2008" "LHa for UNIX" "User Commands" |
---|
26 | |
---|
27 | .SH NAME |
---|
28 | LHa for UNIX \- Traditional compressor and archiver. |
---|
29 | |
---|
30 | .SH SYNOPSIS |
---|
31 | |
---|
32 | lha |
---|
33 | [\-]\fIcommand\fR[\fIoptions\fR] [\-\fIoptions\fR ...] |
---|
34 | archive_file.lzh |
---|
35 | [files...] |
---|
36 | .TP |
---|
37 | .B Create an archive |
---|
38 | .nf |
---|
39 | lha c archive_file.lzh files or directories. |
---|
40 | .fi |
---|
41 | .TP |
---|
42 | .B Extract the archive |
---|
43 | .nf |
---|
44 | lha x archive_file.lzh [specific files] |
---|
45 | .fi |
---|
46 | .TP |
---|
47 | .B List the archive |
---|
48 | .nf |
---|
49 | lha l archive_file.lzh [specific files] |
---|
50 | \.fi |
---|
51 | or |
---|
52 | .nf |
---|
53 | lha archive_file.lzh [specific files] |
---|
54 | .fi |
---|
55 | .SH DESCRIPTION |
---|
56 | The LHa for UNIX is an archiver and compressor using the LZSS and the Huffman encoding compression algorithm. |
---|
57 | It is possible to create the archive file called the "LZH" file, and possible to extract it. |
---|
58 | |
---|
59 | It is possible to extract the self-extracting archive file called the SFX file (mainly created on the MS-DOS and the MS-Windows), but impossible to create it. |
---|
60 | |
---|
61 | .SH COMMANDS |
---|
62 | |
---|
63 | .TP |
---|
64 | \fB\-c\fR, \fB\-a\fR |
---|
65 | Specified files are compressed and archived into an archive file. |
---|
66 | When the directory path is specified, files under the directory are archived recursively. |
---|
67 | |
---|
68 | The \fB\-c\fR command creates new archive. When the archive file already exists, it is overwritten. |
---|
69 | The \fB\-a\fR command creates new archive or appends to existent archive. |
---|
70 | |
---|
71 | .TP |
---|
72 | \fB\-x\fR, \fB\-e\fR |
---|
73 | The \fB\-x\fR command extracts uncompressed files from the archive file. |
---|
74 | When the specific_files is specified, Only these files or directories are extracted. |
---|
75 | The \fB\-e\fR command is synonym of \fB\-x\fR. |
---|
76 | |
---|
77 | .TP |
---|
78 | \fB\-l\fR, \fB\-v\fR |
---|
79 | The \fB\-l\fR command lists the contents of archive to stdout. The \fB\-v\fR command is more verbosely command. |
---|
80 | The term of list is below. |
---|
81 | .RS |
---|
82 | .TP |
---|
83 | PERMISSION |
---|
84 | For the Unix specific archive, it is permission string like \fBls\fR(1). |
---|
85 | For the others, it is the string of OS type. |
---|
86 | .TP |
---|
87 | UID/GID |
---|
88 | For the Unix specific archive, it is user-id and group-id. |
---|
89 | For the others, it is space only. |
---|
90 | .TP |
---|
91 | PACKED |
---|
92 | The size of compressed file. it is shown by the \fB\-v\fR command. |
---|
93 | .TP |
---|
94 | SIZE |
---|
95 | The original file size. |
---|
96 | .TP |
---|
97 | RATIO |
---|
98 | Compressed ratio (PACKED / SIZE * 100). |
---|
99 | .TP |
---|
100 | METHOD |
---|
101 | The string of the compressing method. it is shown by the \fB\-v\fR command. |
---|
102 | .RS |
---|
103 | .TP |
---|
104 | \-lh0\- |
---|
105 | no compressed. |
---|
106 | .TP |
---|
107 | \-lzs\- |
---|
108 | 2k sliding dictionary (created by the LArc) |
---|
109 | .TP |
---|
110 | \-lz4\- |
---|
111 | no compressed. (created by the LArc) |
---|
112 | .TP |
---|
113 | \-lz5\- |
---|
114 | 4k sliding dictionary (created by the LArc) |
---|
115 | .TP |
---|
116 | \-lh1\- |
---|
117 | 4k sliding dictionary and dynamic Huffman encoding. |
---|
118 | .TP |
---|
119 | \-lh2\- |
---|
120 | 8k sliding dictionary and dynamic Huffman encoding. |
---|
121 | .TP |
---|
122 | \-lh3\- |
---|
123 | 8k sliding dictionary and static Huffman encoding. |
---|
124 | .TP |
---|
125 | \-lh4\- |
---|
126 | 4k sliding dictionary and static Huffman encoding. |
---|
127 | .TP |
---|
128 | \-lh5\- |
---|
129 | 8k sliding dictionary and static Huffman encoding. |
---|
130 | .TP |
---|
131 | \-lh6\- |
---|
132 | 32k sliding dictionary and static Huffman encoding. |
---|
133 | .TP |
---|
134 | \-lh7\- |
---|
135 | 64k sliding dictionary and static Huffman encoding. |
---|
136 | .TP |
---|
137 | \-lhd\- directory |
---|
138 | |
---|
139 | .RE |
---|
140 | The LHa for Unix is able to create the methods \-lh0\-, \-lh1\-, \-lh5\-, \-lh6\-, \-lh7\- and \-lhd\-. |
---|
141 | |
---|
142 | .TP |
---|
143 | CRC |
---|
144 | The CRC-16 code. It is shown by the \fB\-v\fR command. |
---|
145 | |
---|
146 | .TP |
---|
147 | STAMP |
---|
148 | The timestamp of the file. It is shown the full-time format with the \fB\-v\fR option. |
---|
149 | |
---|
150 | .TP |
---|
151 | LV |
---|
152 | The header level. It is shown by the \fB\-v\fR option. |
---|
153 | |
---|
154 | The level 0 and 1 are deprecated. The level 2 header is widely used. |
---|
155 | The level 3 header is more improved, however, it is rarely used. |
---|
156 | |
---|
157 | The LHa for Unix is able to create the 0, 1 and 2. (Level 3 is readable.) |
---|
158 | |
---|
159 | .TP |
---|
160 | NAME |
---|
161 | Filename or directory name. |
---|
162 | .RE |
---|
163 | |
---|
164 | .TP |
---|
165 | \fB\-u\fR |
---|
166 | The \fB\-u\fR command updates the archive. When the specified files are newer than the content of the archive, they are replaced. |
---|
167 | The \fB\-a\fR command always replace with the specified files. |
---|
168 | |
---|
169 | .TP |
---|
170 | \fB\-m\fR |
---|
171 | The \fB\-m\fR command moves specified files into the archive. |
---|
172 | It is same as the \fB\-ad\fR (\fB\-a\fR command and \fB\-d\fR option). |
---|
173 | |
---|
174 | .TP |
---|
175 | \fB\-d\fR |
---|
176 | The \fB\-d\fR command delete the specified files from the archive. |
---|
177 | |
---|
178 | .TP |
---|
179 | \fB\-p\fR |
---|
180 | The \fB\-p\fR command print the content of the archived files to stdout. |
---|
181 | Each contents are printed with filename as header string like below. |
---|
182 | |
---|
183 | :::::::: |
---|
184 | filename |
---|
185 | :::::::: |
---|
186 | contents of the file..... |
---|
187 | |
---|
188 | If you wish to non-display the header string, use with the \fB\-q\fR option. |
---|
189 | |
---|
190 | .TP |
---|
191 | \fB\-t\fR |
---|
192 | The \fB\-t\fR command is the same as the \fB\-x\fR command except to non-extract actually. |
---|
193 | This command is used to check the archive file. |
---|
194 | |
---|
195 | .SH OPTIONS |
---|
196 | |
---|
197 | .TP |
---|
198 | \fB\-q\fR[\fInum\fR] |
---|
199 | The \fB\-q\fR option specifies the level of quiet mode. \fInum\fR is 0, 1, 2 or nothing. |
---|
200 | |
---|
201 | The \fB\-q\fR0 option is default level. |
---|
202 | The \fB\-q\fR1 option inhibits the extracting indicator (progress bar). |
---|
203 | The \fB\-q\fR2 option inhibits other output decoration. this option has the effects of the \fB\-f\fR option. |
---|
204 | The \fB\-q\fR is same as \fB\-q\fR2. |
---|
205 | |
---|
206 | .TP |
---|
207 | \fB\-v\fR |
---|
208 | When listing with the \fB\-l\fR or the \fB\-v\fR command, the \fB\-v\fR option lists more verbosely. |
---|
209 | |
---|
210 | Elements are listed one file per two lines. The first line shows the filename, following line shows other elements and the timestamp (full-time format) and the header level. |
---|
211 | |
---|
212 | In special case, the \fB\-v\fR command trailing two \fB\-v\fR options like, |
---|
213 | lha vvv archive_file.lzh |
---|
214 | shows the header dump. This is a debugging feature. |
---|
215 | |
---|
216 | .TP |
---|
217 | \fB\-n\fR |
---|
218 | The \fB\-n\fR option displays the message instead of doing the command action. |
---|
219 | |
---|
220 | .TP |
---|
221 | \fB\-f\fR |
---|
222 | Force extraction. When extracted file already exists, |
---|
223 | normally, lha asks for the Overwriting, or Skipping or All files skipping. |
---|
224 | This option forces overwrite without asking. |
---|
225 | |
---|
226 | .TP |
---|
227 | \fB\-t\fR |
---|
228 | The \fB\-t\fR option treats archiving or extracting files as text files. |
---|
229 | When extracting, CR codes on the end of each lines are removed. (convert DOS format text to UNIX format text) |
---|
230 | When archiving, oppositely, CR codes append on the end of each lines. (convert UNIX format text to DOS format text) |
---|
231 | With the \fB\-e\fR option, KANJI code are converted as well. |
---|
232 | |
---|
233 | .TP |
---|
234 | \fB\-o\fR[5\-7] |
---|
235 | When archiving, the \fB\-o\fR option specifies the compressing method. |
---|
236 | the \fB\-o\fR5 means to use the \-lh5\- method. It is widely used and default method. |
---|
237 | the \fB\-o\fR6 and \fB\-o\fR7 means to use the \-lh6\- and \-lh7\- method. |
---|
238 | These methods reduced archive file more than the \-lh5\- method. |
---|
239 | Just the \fB\-o\fR means to use the \-lh1\- method. |
---|
240 | |
---|
241 | It is possible to include some methods in an archive file. |
---|
242 | |
---|
243 | .TP |
---|
244 | \fB\-d\fR |
---|
245 | When archiving, specified files are removed from the disk. |
---|
246 | |
---|
247 | .TP |
---|
248 | \fB\-i\fR |
---|
249 | When extracting, ignore the directory path. extracting file is put flatten on the current directory. |
---|
250 | |
---|
251 | .TP |
---|
252 | \fB\-z\fR |
---|
253 | When archiving, do not compress the specified file. (archive with the \-lh0\- method) |
---|
254 | |
---|
255 | .TP |
---|
256 | \fB\-g\fR |
---|
257 | When extracting, this option does nothing. It exists for historical reason. |
---|
258 | |
---|
259 | When archiving with this option, archive with general (obsolete) header format. |
---|
260 | It uses the level 0 header, filename is uppercased in the archive,Unix specific elements such as permission, user-id and so on are not saved. |
---|
261 | |
---|
262 | .TP |
---|
263 | \fB\-0\fR, \fB\-1\fR, \fB\-2\fR |
---|
264 | The \-0, \-1 and \-2 option specifies the version of the format header (called the header level). |
---|
265 | |
---|
266 | .TP |
---|
267 | \fB\-e\fR |
---|
268 | When archiving, the \fB\-e\fR option regard the coding of text as EUC-JP and convert it to Shift_JIS. |
---|
269 | When extracting, convert from Shift_JIS to EUC-JP. |
---|
270 | |
---|
271 | .TP |
---|
272 | \fB\-b\fR |
---|
273 | When extracting, If it is possible, the MacBinary is interpreted. |
---|
274 | This option is experimental. |
---|
275 | |
---|
276 | .TP |
---|
277 | \fB\-w\fR=\fIdir\fR |
---|
278 | When extracting, extract files are create in the \fIdir\fR directory. |
---|
279 | |
---|
280 | An equal mark is omittable like, \-w dir. |
---|
281 | |
---|
282 | .TP |
---|
283 | \fB\-x\fR=\fIpattern\fR |
---|
284 | When archiving, exclude files matched the glob pattern \fIpattern\fR. |
---|
285 | It is possible to use this option anywhere in the command line. |
---|
286 | |
---|
287 | An equal mark is omittable like, \-x pattern. |
---|
288 | |
---|
289 | .SH LONG OPTIONS |
---|
290 | |
---|
291 | .TP |
---|
292 | \fB\-\-archive\-kanji\-code\fR={euc,sjis,utf8,cap,none} |
---|
293 | Specifies the multi-byte encoding of the archived pathname. |
---|
294 | |
---|
295 | Default is sjis as Shift_JIS. |
---|
296 | |
---|
297 | On LZH file, the encoding of pathname in archive is not ruled. |
---|
298 | However, In Japan, Shift_JIS (exactly Windows-31J) is defacto standard. |
---|
299 | |
---|
300 | .TP |
---|
301 | \fB\-\-system\-kanji\-code\fR={euc,sjis,utf8,cap,none} |
---|
302 | This option specifies the encoding of the pathname on the filesystem. |
---|
303 | Default is euc as EUC-JP. |
---|
304 | |
---|
305 | .TP |
---|
306 | \fB\-\-extract\-broken\-archive\fR |
---|
307 | If CRC error occurrs when extracting, and its archive is created by old version of LHa for UNIX, this option may be last resort. |
---|
308 | |
---|
309 | .TP |
---|
310 | \fB\-\-convert\-filename\-case\fR |
---|
311 | When extracting, the archive format is MS-DOS or Generic, and the |
---|
312 | whole filename (and directory name) is uppercase, extracted |
---|
313 | filename will be in lowercase. |
---|
314 | |
---|
315 | It was default behavior on the old version of the LHa for UNIX. |
---|
316 | However, many software create the LZH archive with case-sensitive filename even if it is a MS-DOS type archive. |
---|
317 | Therefore, its behavior was deprecated as default. |
---|
318 | |
---|
319 | .TP |
---|
320 | \fB\-\-ignore\-mac\-files\fR |
---|
321 | When archiving, the Mac specific files are ignored. |
---|
322 | |
---|
323 | This option is same as the `\fB\-x\fR "._*" \fB\-x\fR ".DS_Store" \fB\-x\fR "Icon\\r"'. |
---|
324 | |
---|
325 | .TP |
---|
326 | \fB\-\-traditional\fR |
---|
327 | Turn on the compatible mode for the old version. |
---|
328 | For now, same as the \fB\-\-convert\-filename\-case\fR. |
---|
329 | |
---|
330 | .TP |
---|
331 | \fB\-\-help\fR |
---|
332 | Show the briefly usage. |
---|
333 | |
---|
334 | .TP |
---|
335 | \fB\-\-version\fR |
---|
336 | Show the version string. |
---|
337 | |
---|
338 | .SH SEE ALSO |
---|
339 | \fBzip\fR(1), \fBunzip\fR(1), \fBgzip\fR(1), \fBgunzip\fR(1), \fBzcat\fR(1) |
---|
340 | |
---|
341 | .SH AUTHOR |
---|
342 | Koji Arai <arai@users.sourceforge.jp> |
---|
343 | |
---|
344 | .SH HISTORY |
---|
345 | In 1988, Haruhiko Okumura developed the LZARI. It was experimental implementation used the LZSS and the arithmetic coding. |
---|
346 | |
---|
347 | Kazuhiko Miki developed the LArc. (it was used the \-lzs\- method) |
---|
348 | |
---|
349 | Haruyasu Yoshizaki developed the LZHUFF (it was experimental code with the LZSS and the Huffman coding), and developed the LHarc version 1.00. |
---|
350 | |
---|
351 | In 1989, the LHarc was ported on UNIX by Yoichi Tagawa. |
---|
352 | |
---|
353 | Haruhiko Okumura and Haruyasu Yoshizaki improved the algorithm of the LHarc. |
---|
354 | |
---|
355 | In 1990, the LHx 2.00 which is the LHarc improvement was implemented by Haruyasu Yoshizaki. |
---|
356 | The ar002 was implemented by Haruhiko Okumura. It is distributed as the Public Domain Software. |
---|
357 | |
---|
358 | In 1991, Haruyasu Yoshizaki improved the LHx and renamed to the LHa, and renamed again to the LHA. |
---|
359 | |
---|
360 | In Japan, This version (LHA 2.10 - 2.13) was widely used on MS-DOS and MS-Windows. |
---|
361 | Many software and many documents are distributed with this archive format. |
---|
362 | |
---|
363 | In 1992, It was ported on UNIX by Masaru Oki. It was called the LHa for UNIX, and it was improved by Nobutaka Watazaki, Tsugio Okamoto and many users. |
---|
364 | |
---|
365 | The LHa for UNIX was used to exchange files for MS-DOS world, and its source codes might be used interestingly and implement another LZH archiver. |
---|
366 | |
---|
367 | However, its license is vague. so it is not recognized as the Open Source Software defined by the Open Source Initiative. |
---|