LinuxCommandLibrary

lzma

compresses files using the Lempel-Ziv-Markov chain Algorithm

TLDR

Compress file

$ lzma [file]
copy
Decompress file
$ lzma -d [file.lzma]
copy
Keep original file
$ lzma -k [file]
copy
Compress to stdout
$ lzma -c [file] > [file.lzma]
copy
Set compression level
$ lzma -9 [file]
copy
Test archive integrity
$ lzma -t [file.lzma]
copy

SYNOPSIS

lzma [options] [files...]

DESCRIPTION

lzma compresses files using the Lempel-Ziv-Markov chain Algorithm. It provides high compression ratios at the cost of slower compression speed.
The lzma command is typically a symlink to xz, which supports the legacy .lzma format alongside the newer .xz format.

PARAMETERS

-d, --decompress

Decompress.
-z, --compress
Compress (default).
-k, --keep
Keep original files.
-c, --stdout
Write to stdout.
-1 to -9
Compression level.
-e, --extreme
Maximum compression.
-t, --test
Test integrity.
-f, --force
Force overwrite.

COMPARISON

$ Tool     Compression  Speed
gzip     Medium       Fast
bzip2    Good         Medium
lzma/xz  Best         Slow
copy

CAVEATS

Slower compression than gzip. High memory usage at extreme levels. Legacy format; prefer xz for new files.

HISTORY

LZMA was developed by Igor Pavlov for the 7-Zip archiver in 1998. The algorithm was later standardized and the xz format created as a modern container.

SEE ALSO

xz(1), gzip(1), bzip2(1), 7z(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community