Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

Using lzma

The lzma compression delivers better compression ratios than gzip and bzip2.

To compress a file using lzma use the command as follows:

    $ lzma filename

To extract a lzma file, use the following command:

    $ unlzma filename.lzma

A tarball can be compressed with the -lzma option:

    $ tar -cvvf --lzma archive.tar.lzma [FILES]

Alternatively, this can be used:

    $ tar -cavvf archive.tar.lzma [FILES]

To extract a tarball created with lzma compression to a specified directory, use this command:

    $ tar -xvvf --lzma archive.tar.lzma -C extract_directory

In the preceding command, -x is used for extraction. --lzma specifies the use of lzma to decompress the resulting file.

Alternatively, use this:

    $ tar -xavvf archive.tar.lzma -C extract_directory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985