English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux lha command

Linux Command大全

The Linux lha command is used to compress or decompress files.

lha is a compression program evolved from lharc, and the files compressed by it will 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][File...] 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][Directory...]

Parameters:

  • -a or a: Compress the file and add it to the compressed file.
  • -a<0/1/2>/u</0/1/2>: Use different file headers when compressing files.
  • -c or c: Compress the file, reconstruct a new compressed file, and then add it.
  • -d or d: Delete the specified file from the compressed file.
  • -<a/c/u>d or <a/c/u>d: Compress the file, then add it, reconstruct, update the compressed file, or delete the original file, which is to move the file into the compressed file.
  • -e or e: Unzip the compressed file.
  • -f or f: Force the execution of the lha command, and during decompression, it will directly overwrite existing files without asking.
  • -g or g: Use the general compression format to facilitate compatibility issues.
  • -<e/x>i or <e/x>i When unzipping the compressed file, ignore the file path saved in the compressed file, and directly decompress it into the current directory or the specified directory.
  • -l or l List the relevant information of the compressed file.
  • -m or m The effect of this parameter is the same as specifying"-ad"parameters are the same.
  • -n or n Do not execute the command, just list the actions that will be executed actually.
  • -<a/u>o or <a/u>o Use lharc compatible format, add the compressed file after compression, 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 execution process of the command.
  • -t or t Check if each file in the backup file is correct and error-free.
  • -u or u Replace the newer file into the compressed file.
  • -u</0/1/2> or u</0/1/2> Use a different file header when compressing files, and then update it to 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 to unzip to.
  • -x or x Unzip the compressed file.
  • -<a/u>z or <a/u>z Do not compress the file, directly add it and update the compressed file.

Online Example

Compress file

# lha -a abc.lhz a.b //Compress a.b file, after compression generate abc.lhz file

Compress directory

# lha -a abc2 /home/hnlinux

Unzip file to the current directory

# lha -xiw=agis abc  //Unzip file abc

Linux Command大全