xz

Version:

5.2.5

Category:

tools

Cluster:

Loki, Vali

Author / Distributor

https://tukaani.org/xz/

Description

XZ is a general-purpose data compression tool with command line syntax similar to gzip(1) and bzip2(1). The native file format is the .xz format, but the legacy .lzma format used by LZMA Utils and raw compressed streams with no container format headers are also supported.

XZ compresses or decompresses each file according to the selected operation mode. If no files are given or file is -, xz reads from standard input and writes the processed data to standard output. XZ will refuse (display an error and skip the file) to write compressed data to standard output if it is a terminal. Similarly, xz will refuse to read compressed data from standard input if it is a terminal.

Documentation

Usage: xz [OPTION]... [FILE]...
Compress or decompress FILEs in the .xz format.

  -z, --compress      force compression
  -d, --decompress    force decompression
  -t, --test          test compressed file integrity
  -l, --list          list information about .xz files
  -k, --keep          keep (don't delete) input files
  -f, --force         force overwrite of output file and (de)compress links
  -c, --stdout        write to standard output and don't delete input files
  -0 ... -9           compression preset; default is 6; take compressor *and*
                     decompressor memory usage into account before using 7-9!
  -e, --extreme       try to improve compression ratio by using more CPU time;
                    does not affect decompressor memory requirements
  -T, --threads=NUM   use at most NUM threads; the default is 1; set to 0
                    to use as many threads as there are processor cores
  -q, --quiet         suppress warnings; specify twice to suppress errors too
  -v, --verbose       be verbose; specify twice for even more verbose
  -h, --help          display this short help and exit
  -H, --long-help     display the long help (lists also the advanced options)
  -V, --version       display the version number and exit

With no FILE, or when FILE is -, read standard input.

Examples/Usage

  • Load the xz module:

    $ module load xz
    
  • Check the loaded modules:

    $ module list
    
  • List available modules:

    $ module avail xz
    
  • Unload the xz module:

    $ module unload xz
    
  • Compress a directory using tar and xz:

    $ tar -cJf archive.tar.xz directory_name/
    
  • Extract an xz compressed tar archive:

    $ tar -xJf archive.tar.xz
    
  • Compress a file and creates file.txt.xz:

    $ xz file.txt
    
  • Decompress a file and restores file.txt:

    $ xz -d file.txt.xz
    
  • List details of an xz-compressed file:

    $ xz -l file.txt.xz
    

Installation

Source code is obtained from Tukaani XZ