$
Learn Linux handbook
en
XP:0
Quest 125Squeezer
+180 XP

Alternative Compression (bzip2 & xz)

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

Concept & Overview

Beyond gzip and zip, Linux supports other compression formats optimized for higher compression ratios at the expense of CPU speed. These are bzip2 (bz2) and xz (xz).

- The bzip2 command compresses a file, outputting .bz2.
- The xz command uses lossless LZMA compression to create .xz, which yields exceptionally small file sizes, making it ideal for Linux kernel releases.

Let's compare formats. Compress note.txt using bzip2 note.txt. Then, compress the resulting files using xz note.txt (to simulate both).

Command Syntax Reference

Command / SyntaxDescription
bzip2 note.txtCompress note.txt using bzip2
xz note.txtCompress note.txt using xz

Verification Objectives

These conditions will be automatically verified when you run commands inside the interactive terminal simulator:

  • ○
    Run bzip2 note.txt
  • ○
    Run xz note.txt

Ready to complete Quest 125?

Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.