Linux lha Command
The Linux lha command is used for compressing or decompressing files.
lha is a compression program derived from lharc. When files are compressed with it, they produce compressed files with the ".lzh" extension.
Syntax
lha [-acdfglmnpqtuvx][-a <0/1/2>/u</0/1/2>][-<a/c/u>d][-<e/x>i][-<a/u>o][-<e/x>w=<destination directory>][-<a/u>z][compressed file][files...] or lha [-acdfglmnpqtuvx][-a <0/1/2>/u</0/1/2>][-<a/c/u>d][-<e/x>i][-<a/u>o][-<e/x>w=<destination directory>][-<a/u>z][compressed file][directories...]
Parameters:
-a or a: Compress files and add them to the compressed file.
-a<0/1/2>/u</0/1/2>: Compress files with different headers.
-c or c: Compress files, reconstruct the new compressed file, and then add them.
-d or d: Delete the specified file from the compressed file.
-<a/c/u>d or <a/c/u>d: Compress files, add them, reconstruct, update the compressed file, or delete the original files, effectively moving them to the compressed file.
-e or e: Decompress the compressed file.
-f or f: Force the execution of the lha command, overwriting existing files without asking during decompression.
-g or g: Use a generic compression format to facilitate compatibility issues.
-<e/x>i or <e/x>i: Decompress the compressed file, ignoring the file paths stored in the compressed file, and directly decompress them to the current directory or the specified directory.
-l or l: List information about the compressed file.
-m or m: This parameter has the same effect as specifying both "-ad" parameters.
-n or n: Do not execute the command, only list the actions that would be performed.
-<a/u>o or <a/u>o: Use the lharc compatible format, add the compressed file, and update the compressed file.
-p or p: Output from the compressed file to the standard output device.
-q or q: Do not display the command execution process.
-t or t: Check if each file in the backup file is correct.
-u or u: Replace newer files in the compressed file.
-u</0/1/2> or u</0/1/2>: Use different headers when compressing files and update them in the compressed file.
-v or v: List detailed information about the compressed file.
-<e/x>w=<destination directory> or <e/x>w=<destination directory>: Specify the directory for decompression.
-x or x: Decompress the compressed file.
-<a/u>z or <a/u>z: Do not compress the file, directly add it, and update the compressed file.
Examples
Compress file:
# lha -a abc.lhz a.b // Compress file a.b, producing the abc.lhz file
Compress directory:
# lha -a abc2 /home/hnlinux
Decompress file to the current directory:
# lha -xiw=agis abc // Decompress file abc