"xz/unxz" - Compressed *.xz or *.lzma Files

This section provides a tutorial example on how to use 'xz' and 'unxz' commands to compress large files and restore them later. Compressed files will have the *.xz file name extension.

If you have a large file, you may want to compress it with the "xz" utility to save storage space.

1. Compress a file with the "xz" command, which uses the LZMA2 algorithm. The original file is replaced with the compressed version and renamed to the same name plus the extension .xz.

herong$ cp history-of-Linux.txt history-of-Linux-bck.txt

herong$ xz history-of-Linux.txt

herong$ ls -l history*
-rw-r--r--  1 herong  staff  1444  history-of-Linux-bck.txt
-rw-r--r--. 1 herong  staff   916  history-of-Linux.txt.xz

2. Restore a compressed file with the "unxz" command. The compressed file is replaced with the restored version and renamed to the original name without the extension .xz.

herong$ unxz history-of-Linux.txt.xz

herong$ ls -l history*
-rw-r--r--  1 herong  staff  1444  history-of-Linux-bck.txt
-rw-r--r--  1 herong  staff  1444  history-of-Linux.txt

Table of Contents

 About This Book

 Introduction to Ubuntu Systems

 GNOME - Desktop Interface and Environment

 Shell - The Command-Line Interpreter

 Process Management

 Memory Management

Files and Directories

 "find" - Search for Files

 "more", "head" and "cat" - Read Files

 "split" and "cat" - Split and Join Files

 Truncate Log Files

 "compress/uncompress" - Compressed *.Z Files

 "gzip/gunzip" - Compressed *.gz Files

"xz/unxz" - Compressed *.xz or *.lzma Files

 "tar -c" and "tar -x" - Create and Extract Archive Files

 "zip" and "unzip" - Create and Extract ZIP Files

 "rar" and "unrar" - Roshal Archive Files

 APT (Advanced Package Tool)

 Network Connection on Ubuntu

 Internet Networking Tools

 SSH Protocol and ssh/scp Commands

 Administrative Tasks

 References

 Full Version in PDF/EPUB