How to use lzma for compression
LZMA is an improved version of famous LZ77 compression algorithm. It was improved in way of maximum increasing of compression ratio, keeping high decompression speed and low memory requirements for decompressing. lzma command line tool has a similar interface to gzip(1) and bzip2(1) and is intended to make use of LZMA compression easy for the users who are already familiar with gzip and bzip2.
The following will compress a file. The -k option states for lzma to do not delete the input file after compression. The -v option stands for verbose mode and the -z option states for you to compress the file.
lzma -9kvz filename.lzma
Specifying a number -1 through -9 states the compression ration. -1 being the fastest and -9 being the best compression. You will have to install lzma from your repo’s more than likely.
To decompress a file simply type: (again the -k states to keep the original file)
unlzma -k filename.lzma
And to see the contents of the file without extration
lzcat filename.lzma
This will display the contents of the lzma’d file. I wouldn’t recommend doing this to a tarbal that has been compressed with lzma.
Related Posts
Tags: compression, decompression, lzma