Usage
Four commands — everything else is a flag on top.
List archive contents: lha l archive.lzh
The most common operation. The output lists every member of the archive with size, ratio, and timestamp:
$ lha l README.lzh
PERM UID GID SIZE RATIO STAMP NAME
[generic] 1234 60.0% Jul 14 20:30 README.md
[generic] 5678 72.5% Jul 14 20:30 src/main.c
---------- -------------------- ------- ----------
2 files, 6912 bytes (62.5%)
Add v for verbose (path permissions + CRC):
$ lha lv README.lzh
Use v twice for ultra-verbose (per-block info):
$ lha lvv README.lzh
Extract: lha x archive.lzh
The default extract mode. Files are written relative to the current directory, with the path as stored in the archive:
$ lha x archive.lzh
Common options:
q(quiet) — skip per-file output:lha xq archive.lzhw=DIR— extract intoDIR(creates if missing):lha xw=output archive.lzhf— force overwrite without prompting:lha xf archive.lzhi— ignore directory entries (extract files but skip recreating the directory hierarchy):lha xi archive.lzh
Filter to specific members using glob patterns:
$ lha x archive.lzh "*.c" # only *.c members
$ lha x archive.lzh src/* # only files under src/
Verify CRC: lha t archive.lzh
Walks the archive, recomputes each member's CRC16, compares against the stored value. Exit code 0 = all members OK; non-zero = a member failed CRC (archive is corrupt or partially written):
$ lha t README.lzh
test README.lzh : OK
Use this in CI artifact verification — e.g. after downloading
an .lzh from an upstream mirror, sanity-check it with
lha t before extracting.
Print to stdout: lha p archive.lzh file
Print a single archive member to stdout, decompressed.
Equivalent to tar -xOf archive.lzh file:
$ lha p README.lzh src/main.c | head -5
/* main.c — entry point */
With no member filter, lha p prints every member
in sequence. Useful for piping into grep /
less / another archiving tool:
$ lha p archive.lzh | grep TODO
What lhasa does not do
Lhasa is decoder-only. It cannot:
- Create a new
.lzharchive. Use the originallhabinary built from upstream jca02266/lha (LHa for UNIX 1.14i) for that. - Write a new
.lzsor.pmaarchive. Same story — lhasa's encoder path was never developed on purpose.
For reads (the 99% use case in 2026), lhasa is the canonical free tool.