1 .\" -*- indent-tabs-mode: nil -*-
3 .\" Copyright (c) 2008 Koji Arai
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:
13 .\" The above copyright notice and this permission notice shall be
14 .\" included in all copies or substantial portions of the Software.
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
25 .TH LHA "1" "February 2008" "LHa for UNIX" "User Commands"
28 LHa for UNIX \- Oldish compressor and archiver.
33 [\-]\fIcommand\fR[\fIoptions\fR] [\-\fIoptions\fR ...]
39 lha c archive_file.lzh files or directories.
42 .B Extract the archive
44 lha x archive_file.lzh [specific files]
49 lha l archive_file.lzh [specific files]
53 lha archive_file.lzh [specific files]
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.
59 It is possible to extract the self-extracting archive file called the SFX file. (It is mainly created on the MS-DOS and the MS-Windows), but impossible to create it.
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.
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.
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.
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.
84 For the Unix specific archive, it is permission string like ls(1).
85 For the others, it is the string of OS type.
88 For the Unix specific archive, it is user-id and group-id.
89 For the others, it is space only.
92 The size of compressed file. it is shown by the \fB\-v\fR command.
95 The original file size.
98 Compressed ratio (PACKED / SIZE * 100).
101 The string of the compressing method. it is shown by the \fB\-v\fR command.
108 2k sliding dictionary (created by the LArc)
111 no compressed. (created by the LArc)
114 4k sliding dictionary (created by the LArc)
117 4k sliding dictionary and dynamic Huffman encoding.
120 8k sliding dictionary and dynamic Huffman encoding.
123 8k sliding dictionary and static Huffman encoding.
126 4k sliding dictionary and static Huffman encoding.
129 8k sliding dictionary and static Huffman encoding.
132 32k sliding dictionary and static Huffman encoding.
135 64k sliding dictionary and static Huffman encoding.
140 The LHa for Unix is able to create the methods \-lh0\-, \-lh1\-, \-lh5\-, \-lh6\-, \-lh7\- and \-lhd\-.
144 The CRC-16 code. It is shown by the \fB\-v\fR command.
148 The timestamp of the file. It is shown the full-time format with the \fB\-v\fR option.
152 The header level. It is shown by the \fB\-v\fR option.
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.
157 The LHa for Unix is able to create the 0, 1 and 2. (level 3 is readable)
161 Filename or directory name.
166 The \fB\-u\fR command updates the archive. When the specified files newer than the content of the archive, it is replaced.
167 The \fB\-m\fR command always replace with the specified files.
171 The \fB\-d\fR command delete the specified files from the archive.
175 The \fB\-p\fR command print the content of the archived files to stdout.
176 Each contents are printed with filename as header string like below.
181 contents of the file.....
183 The header string is omitable by the \fB\-q\fR option.
187 The \fB\-t\fR command same as the \fB\-x\fR command except to non-extract actually.
188 This command is used to check the archive file.
194 The \fB\-q\fR option specify the level of quiet mode. \fInum\fR is 0, 1, 2 or nothing.
196 The \fB\-q\fR0 option is default level.
197 The \fB\-q\fR1 option inhibit to show the extracting indicator(progressing meter?).
198 The \fB\-q\fR2 option inhibit to show the other output decoration. this option has the effects of the \fB\-f\fR option.
199 The \fB\-q\fR is same as \fB\-q\fR2.
203 When listing with the \fB\-l\fR or the \fB\-v\fR command, the \fB\-v\fR option lists more verbosely.
205 Each elements are listed one file per two line. The first line show the filename, following line show other elements added the timestamp (full-time format) and the header level.
207 Special case, the \fB\-v\fR command trailing two \fB\-v\fR options like,
208 lha vvv archive_file.lzh
209 show the header dump. This feature is for debugging.
213 The \fB\-n\fR option display the message instead of doing the command action.
217 Force extraction. When the extract file is already exists,
218 normally, lha ask the Overwriting, or Skipping or All files skipping.
219 This option always make to overwrite without the asking.
223 The \fB\-t\fR option treats extracting files as text file.
224 CR codes on the end of each lines are removed. (convert DOS format text to UNIX format text)
225 With the \fB\-e\fR option, KANJI code in extracting files are converted.
229 When archiving, the \fB\-o\fR option specified the compressing method.
230 the \fB\-o\fR5 means to use the \-lh5\- method. It is widely used and default method.
231 the \fB\-o\fR6 and \fB\-o\fR7 means to use the \-lh6\- and \-lh7\- method.
232 These methods reduced archive file more than the \-lh5\- method.
233 Just the \fB\-o\fR means to use the \-lh1\- method.
235 It is possible to include some methods in an archive file.
239 When archiving, specified files are removed from the disk.
243 When extracting, ignore the directory path. extracting file is put flatten on the current directory.
247 When archiving. no compress the specified file. (archive with the \-lh0\- method)
251 When extracting, this option is nothing to do. this is historical reason.
253 When archiving, this option is archived with general (obsolete) header format.
254 It is used the level 0 header, filename is uppercased in archive, no saved the Unix specific elements such as permission, user-id and so on.
257 \fB\-0\fR, \fB\-1\fR, \fB\-2\fR
258 The \-0, \-1 and \-2 option is specified the format of the header version (called the header level).
262 When archiving, the \fB\-e\fR option regard the coding of text as EUC-JP and convert it to Shift_JIS.
263 When extracting, convert from Shift_JIS to EUC-JP.
267 When extracting, If it is possible, the MacBinary is interpreted.
268 This option is experimental.
272 When extracting, extract files are create in the \fIdir\fR directory.
274 equal mark is omittable like, \-w dir.
277 \fB\-x\fR=\fIpattern\fR
278 When archiving, exclude files matched the glob pattern \fIpattern\fR.
279 This option is able to specify any times in a command line.
281 equal mark is omittable like, \-x pattern.
286 \fB\-\-archive\-kanji\-code\fR={euc,sjis,utf8,cap,none}
287 On LZH file, specifying the filename encoding in archive is not ruled.
288 However, In Japan, Shift_JIS is defacto standard, so the LHa for UNIX is saved with Shift_JIS. this option is able to change it.
290 The utf8 is possible to specify using iconv library.
293 \fB\-\-system\-kanji\-code\fR={euc,sjis,utf8,cap,none}
294 This option specify the filename encoding on the filesystem.
295 Default is euc as EUC-JP.
297 The utf8 is possible to specify using iconv library.
300 \fB\-\-extract\-broken\-archive\fR
301 When extracting, If CRC error is occurred and its archive is created by old version of LHa for UNIX, this option may be last resort.
304 \fB\-\-convert\-filename\-case\fR
305 When extracting, the archive format is MS-DOS or Generic, and the
306 whole of the filename (and directory name) is uppercase, extracted
307 filename make to be small capital.
309 It was default behavior on the old version of the LHa for UNIX.
310 However, many software create the LZH archive with case-sensitive filename even if it is a MS-DOS type archive.
311 Therefore, its behavior was deprecated as default.
314 \fB\-\-ignore\-mac\-files\fR
315 When archiving, the Mac specific files are ignored.
317 This option is same as the `\fB\-x\fR "._*" \fB\-x\fR ".DS_Store" \fB\-x\fR "Icon\\r"'.
320 \fB\-\-traditional\fR
321 Turn on the compatible mode for the old version.
322 For now, same as the \fB\-\-convert\-filename\-case\fR.
326 Show the briefly usage.
330 Show the version string.
333 zip(1), unzip(1), gzip(1), gunzip(1), zcat(1)
339 In 1988, Haruhiko Okumura developed the LZARI. it was experimental implementation used the LZSS and the arithmetic coding.
341 Kazuhiko Miki developed the LArc. (it was used the \-lzs\- method)
343 Haruyasu Yoshizaki developed the LZHUFF (it was experimental code with the LZSS and the Huffman coding), and developed the LHarc version 1.00.
345 In 1989, the LHarc was ported on UNIX by Yoichi Tagawa.
347 Haruhiko Okumura and Haruyasu Yoshizaki improved the algorithm of the LHarc.
349 In 1990, the LHx 2.00 which is the LHarc improvement was implemented by Haruyasu Yoshizaki.
351 The ar002 was implemented by Haruhiko Okumura. It is distributed as the Public Domain Software (the ar002.exe is the SFX file).
353 http://oku.edu.mie-u.ac.jp/~okumura/compression/ar002.exe.
355 Note that it has security problems CVE-2006-4335, 4337 and 4338.
357 In 1991, Haruyasu Yoshizaki improved the LHx and renamed to the LHa, and renamed again to the LHA.
359 In Japan, This version (LHA 2.10 - 2.13) was widely used on MS-DOS and MS-Windows.
360 Many software and many documents are distributed with this archive format.
362 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 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 However, its license is vague. so it is not recognized as the Open Source Software defined by the Open Source Initiative.
370 The extracting code of the \-lzs\- method was broken. But it is not problem that is not used for long time.
372 The LHa for UNIX expects the sorted contents by filename in the LZH archive (like the LHarc), but the LHA (for MS-DOS) does not.