Recall & Review
beginner
What is the main purpose of
bzip2 and xz commands in Linux?They are used to compress and decompress files to save disk space and reduce transfer time.
Click to reveal answer
beginner
How do you compress a file named
file.txt using bzip2?Run the command
bzip2 file.txt. It creates file.txt.bz2 and removes the original file.Click to reveal answer
beginner
How do you decompress a
.xz file named archive.xz?Use the command
unxz archive.xz or xz -d archive.xz. It restores the original file and removes the compressed one.Click to reveal answer
intermediate
Which compression tool generally provides better compression ratio:
bzip2 or xz?xz usually compresses files smaller than bzip2, but it may take more time to compress.Click to reveal answer
intermediate
How can you keep the original file after compressing with
bzip2?Use the
-k option: bzip2 -k file.txt keeps file.txt and creates file.txt.bz2.Click to reveal answer
What file extension does
bzip2 compression create?✗ Incorrect
bzip2 creates files ending with .bz2.Which command decompresses an
.xz file?✗ Incorrect
unxz or xz -d decompress .xz files.How to compress a file with
xz and keep the original file?✗ Incorrect
The
-k option keeps the original file after compression.Which tool is usually faster at compressing files?
✗ Incorrect
bzip2 is generally faster but compresses less tightly than xz.What happens to the original file after running
bzip2 file.txt without options?✗ Incorrect
By default,
bzip2 deletes the original file after compression.Explain how to compress and decompress files using both
bzip2 and xz commands.Think about the commands and file extensions for both tools.
You got /6 concepts.
Compare
bzip2 and xz in terms of compression ratio and speed.Focus on size and speed differences.
You got /5 concepts.