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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. Supported and Recommended File Systems on Linux
  2. nixos-container : Command Examples in Linux
  3. Understanding the Network interface configuration file /etc/sysconfig/network-scripts/ifcfg-eth#
  4. How Files/Directories in /tmp gets Removed Automatically in CentOS/RHEL 5,6
  5. sftp Command Examples in Linux
  6. addr2line Command Examples in Linux
  7. lrunzip: command not found
  8. id Command Examples in Linux
  9. protonvpn-cli Command Examples in Linux
  10. chfn Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright