0
0
Linux CLIscripting~15 mins

gzip and gunzip in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Compress and Decompress Files Using gzip and gunzip
📖 Scenario: You have a text file with important notes that you want to save space on your computer. Compressing the file will make it smaller. Later, you want to open the file again by decompressing it.
🎯 Goal: Learn how to compress a file using gzip and decompress it back using gunzip in the Linux command line.
📋 What You'll Learn
Create a text file named notes.txt with specific content.
Use gzip to compress the notes.txt file.
Use gunzip to decompress the compressed file.
Display the content of the decompressed file.
💡 Why This Matters
🌍 Real World
Compressing files helps save disk space and makes it easier to transfer files over the internet.
💼 Career
Knowing how to compress and decompress files is essential for system administrators, developers, and anyone working with servers or large data files.
Progress0 / 4 steps
1
Create the text file notes.txt
Create a file named notes.txt with the exact content: Hello, this is a test file for gzip compression.
Linux CLI
Need a hint?

Use the echo command with redirection > to create the file.

2
Compress the file using gzip
Use the gzip command to compress the file notes.txt. This will create a compressed file named notes.txt.gz.
Linux CLI
Need a hint?

Simply run gzip notes.txt to compress the file.

3
Decompress the file using gunzip
Use the gunzip command to decompress the file notes.txt.gz. This will restore the original notes.txt file.
Linux CLI
Need a hint?

Run gunzip notes.txt.gz to decompress the file.

4
Display the content of the decompressed file
Use the cat command to display the content of the decompressed file notes.txt.
Linux CLI
Need a hint?

Use cat notes.txt to show the file content.