0
0
Linux CLIscripting~10 mins

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

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to compress a file using gzip.

Linux CLI
gzip [1]
Drag options to blanks, or click blank then click option'
Afile.txt
B-d
C-k
D-v
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which decompresses instead of compressing.
Forgetting to specify the file name.
2fill in blank
medium

Complete the command to decompress a gzip file.

Linux CLI
gzip [1] file.txt.gz
Drag options to blanks, or click blank then click option'
A-d
B-k
C-c
D-v
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-k' which keeps the original file but does not decompress.
Using '-c' which outputs to stdout instead of decompressing the file.
3fill in blank
hard

Fix the error in the command to show compression ratio of a gzip file.

Linux CLI
gzip -l [1]
Drag options to blanks, or click blank then click option'
Afile.txt
Bfile.gz.txt
Cfile
Dfile.txt.gz
Attempts:
3 left
💡 Hint
Common Mistakes
Using the uncompressed file name instead of the compressed one.
Mixing up file extensions.
4fill in blank
hard

Fill in the blank to create a compressed archive and then check its size.

Linux CLI
tar [1] archive.tar.gz folder/ && ls -lh archive.tar.gz
Drag options to blanks, or click blank then click option'
A-xvf
B-czf
C-cf
D-tvf
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-xvf' which extracts files instead of creating.
Using '-tvf' which lists archive contents.
Using '-cf' which creates an uncompressed archive.
5fill in blank
hard

Fill all three blanks to compress a file, check its size, and then decompress it.

Linux CLI
gzip [1] && ls -lh [2] && gzip [3] [2]
Drag options to blanks, or click blank then click option'
Afile.txt
Bfile.txt.gz
C-d
D-k
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to decompress before compressing.
Listing the wrong file name.