How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Learn XZ (Lossless Data Compression Tool) in Linux with Examples

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
16
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Learn XZ Command Examples in Linux

xz is a new general-purpose, command line data compression utility, similar to gzip and bzip2. It can be used to compress or decompress a file according to the selected operation mode. It supports various formats to compress or decompress files.

Selecting a compression utility to use will depend mainly on two factors, the compression speed and rate of a given tool. Unlike its counterparts, xz is not commonly used but offers the best compression.

In this article, we will explain a number of xz command examples for compressing and uncompressing files in Linux.

Learn XZ Command Examples in Linux

The simplest example of compressing a file with xz is as follows, using the -z or --compress option.

$ ls -lh ClearOS-DVD-x86_64.iso
$ xz ClearOS-DVD-x86_64.iso
OR
$ xz -z ClearOS-DVD-x86_64.iso
Learn XZ (Lossless Data Compression Tool) in Linux with Examples

Create XZ Compression File

To decompress a file, use the -d option or unxz utility as shown.

$ xz -d ClearOS-DVD-x86_64.iso
OR
$ unxz ClearOS-DVD-x86_64.iso

To prevent deleting of the input file(s), use the -k flag as follows,

$ xz -k ClearOS-DVD-x86_64.iso

If an operation fails, for instance a compressed file with same name exists, you can use the -f option to force the process.

$ xz -kf ClearOS-DVD-x86_64.iso 

xz also supports different compression preset levels (0 to 9, with default being 6). You can also use aliases such as --fast (but least compression) for 0 or --best for 9 (slow but highest compression). You can specify a compression level as in the examples below.

$ xz -k -8 ClearOS-DVD-x86_64.iso 
$ xz -k --best ClearOS-DVD-x86_64.iso

If you have a small amount of system memory, and want to compress a huge file, you can use the –memory=limit option (where limit can be in MBs or as a percentage of RAM) to set a memory usage limit for compression as follows.

$ xz -k --best --memlimit-compress=10% ClearOS-DVD-x86_64.iso

You can run it in quiet mode using the -q option or enable verbose mode with the -v flag as shown.

$ xz -k -q ClearOS-DVD-x86_64.iso
$ xz -k -qv ClearOS-DVD-x86_64.iso

The following is an example of using tar archiving utility with xz utility.

$ tar -cf - *.txt | xz -7 > txtfiles.tar.xz
OR
$tar -cJf txtfiles.tar.xz *.txt

You can test the integrity of compressed files using the -t option and you can use the -l flag to view information about a compressed file.

$ xz -t txtfiles.tar.xz
$ xz -l txtfiles.tar.xz

For more information, see the man xz page.

xz is a powerful and so far the best compression tool for Linux systems. In this article, we looked at several xz command examples for compressing and uncompressing files. Use the feedback form below to ask questions or share your thoughts about this tool. Also tell us about the compression tool you use.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Install Apache Tomcat 8 on CentOS 7
Linux

How to Install Apache Tomcat 8 on CentOS 7?

February 11, 2020
Install Arch Linux With Btrfs Snapshotting
Uncategorized

Install Arch Linux With Btrfs Snapshotting

February 13, 2020
Next Post

Cricket-CLI – Watch Live Cricket Scores in Linux Terminal

10 Interesting Linux Command Line Tricks and Tips Worth Knowing

How to Make File and Directory Undeletable, Even By Root in Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

How to Update CentOS 7, Ubuntu 16.04, and Debian 8

How to Update CentOS 7, Ubuntu 16.04, and Debian 8

3 years ago

Setup iRedMail on Debian Wheezy

3 years ago
Ncdu a NCurses Based Disk Usage Analyzer and Tracker

How to Install PufferPanel (free Minecraft Control Panel) on CentOS 7

3 years ago

How to Install SonarQube on CentOS 7

3 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.