$
Learn Linux handbook
en
XP:0
Quest 123Compressor
+200 XP

File Compression (gzip & gunzip)

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

Concept & Overview

Imagine you have a single text file containing a massive dataset, and you want to reduce its size to save disk space or speed up sharing. In Linux, we compress individual files using gzip and restore them using gunzip.

- The gzip command compresses a file, replacing it with a compressed version ending in .gz (e.g. backup.txt becomes backup.txt.gz).
- The gunzip command decompresses the file, restoring the original version.

Let's compress a file to save space. Run gzip note.txt in your home folder. Then, decompress the resulting note.txt.gz file back to its original state by running gunzip note.txt.gz.

Command Syntax Reference

Command / SyntaxDescription
gzip note.txtCompress note.txt to note.txt.gz
gunzip note.txt.gzDecompress note.txt.gz back to note.txt

Verification Objectives

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

  • ○
    Run the "gzip" command to compress note.txt
  • ○
    Run the "gunzip" command to restore note.txt

Ready to complete Quest 123?

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