0
0
Linux CLIscripting~20 mins

Why compression saves storage and bandwidth in Linux CLI - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Compression Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does compression reduce file size?
Which of the following best explains why compression saves storage space?
ACompression removes all data except the first few bytes, making files smaller.
BCompression deletes random parts of the file to save space.
CCompression converts files into images, which are always smaller.
DCompression replaces repeated patterns with shorter codes, reducing file size.
Attempts:
2 left
💡 Hint
Think about how repeated information can be shortened.
💻 Command Output
intermediate
2:00remaining
Output of gzip compression command
What is the output of the following command sequence? $ echo "hello hello hello" > file.txt $ gzip file.txt $ ls -l file.txt.gz
Linux CLI
echo "hello hello hello" > file.txt
gzip file.txt
ls -l file.txt.gz
Agzip: file.txt: No such file or directory
B-rw-r--r-- 1 user user 18 date time file.txt.gz
C-rw-r--r-- 1 user user 0 date time file.txt.gz
D-rw-r--r-- 1 user user 20 date time file.txt.gz
Attempts:
2 left
💡 Hint
Check the file size after compression; it should be smaller than original.
📝 Syntax
advanced
2:00remaining
Correct command to compress and keep original file
Which command compresses 'data.log' into 'data.log.gz' but keeps the original 'data.log' file?
Agzip data.log
Bgzip --remove data.log
Cgzip -k data.log
Dgzip -r data.log
Attempts:
2 left
💡 Hint
Look for the option that keeps the original file.
🔧 Debug
advanced
2:00remaining
Why does this decompression command fail?
You run 'gunzip file.txt' but get the error: 'gzip: file.txt: not in gzip format'. Why?
Linux CLI
gunzip file.txt
AThe file is already decompressed and not a gzip file.
BThe file has wrong permissions to decompress.
CThe file is corrupted and cannot be decompressed.
DThe gunzip command is not installed.
Attempts:
2 left
💡 Hint
Check if the file was compressed before.
🚀 Application
expert
2:00remaining
Estimate bandwidth saved by compression
A 10MB log file is compressed to 2MB before sending over the network. How much bandwidth is saved as a percentage?
A80%
B20%
C50%
D200%
Attempts:
2 left
💡 Hint
Calculate the reduction relative to original size.