• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

xz: command not found

by admin

The xz command is a data compression utility, similar to gzip, that reduces the size of selected files and manages files in the .xz file format. The xz command has several options.

Option Used To
-d Decompress a file.
-f Force compression or decompression of a file even if it has multiple links or if the file exists.
-q Suppress all warnings.
-v Display the name and percentage reduction of the compressed or decompressed file.
-t Perform an integrity check on the compressed file.

If you encounter the below error while running the xz command:

xz: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
OS X brew install xz
Debian apt-get install xz-utils
Ubuntu apt-get install xz-utils
Alpine apk add xz
Arch Linux pacman -S xz
Kali Linux apt-get install xz-utils
CentOS yum install xz
Fedora dnf install xz
Raspbian apt-get install xz-utils

Syntax

The syntax of the xz command is:

# xz [options] [file names]

xz Command Examples

1. Compress a file to the xz file format:

# xz file

2. Decompress a xz file:

# xz -d file.xz

3. Compress a file to the LZMA file format:

# xz --format=lzma file

4. Decompress an LZMA file:

# xz -d --format=lzma file.lzma

5. Decompress a file and write to stdout:

# xz -dc file.xz

6. Compress a file, but don’t delete the original:

# xz -k file

7. Compress a file using the fastest compression:

# xz -0 file

8. Compress a file using the best compression:

# xz -9 file

Filed Under: Linux

Some more articles you might also be interested in …

  1. lastb Command Examples in Linux
  2. xz Command Examples in Linux
  3. mcs Command Examples
  4. btrfs scrub Command Examples in Linux
  5. reportbug: command not found
  6. powertop: command not found
  7. Command line parameters in shell scripts
  8. create_ap Command Examples in Linux
  9. LVM and multipathing – sample LVM filter strings
  10. fin: Docksal command-line utility

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright