Challenge - 5 Problems
Gzip & Gunzip Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this gzip command?
You have a file named
example.txt containing the text Hello World. You run the command gzip example.txt. What happens to the files in the directory?Attempts:
2 left
💡 Hint
Think about what gzip does by default to the original file after compression.
✗ Incorrect
By default, gzip compresses the file and replaces the original file with the compressed version having a .gz extension.
💻 Command Output
intermediate2:00remaining
What is the output of this gunzip command?
You have a compressed file
archive.gz. You run gunzip archive.gz. What happens to the files in the directory?Attempts:
2 left
💡 Hint
Consider what gunzip does by default to the compressed file after decompression.
✗ Incorrect
gunzip decompresses the file and removes the original .gz file by default.
📝 Syntax
advanced2:00remaining
Which command correctly compresses multiple files into one gzip archive?
You want to compress files
file1.txt and file2.txt into a single compressed file named files.gz. Which command achieves this?Attempts:
2 left
💡 Hint
gzip alone compresses single files; to combine multiple files, use the -c option and redirect output.
✗ Incorrect
Using 'gzip -c file1.txt file2.txt > files.gz' compresses both files' contents into one gzip stream saved as files.gz.
💻 Command Output
advanced2:00remaining
What error does this command produce?
You run
gunzip -c missingfile.gz but the file missingfile.gz does not exist. What is the output?Attempts:
2 left
💡 Hint
Think about what happens when a command tries to access a file that does not exist.
✗ Incorrect
The error message indicates the file is missing, so gunzip cannot open it.
🚀 Application
expert3:00remaining
How to decompress a gzip file and save output to a different file?
You have a compressed file
data.gz. You want to decompress it but save the output to output.txt without deleting data.gz. Which command achieves this?Attempts:
2 left
💡 Hint
Use an option that decompresses to standard output without removing the original file.
✗ Incorrect
The -c option decompresses to stdout, so redirecting output saves it to a new file without deleting the original.