Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to compress a file using gzip.
Linux CLI
gzip [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which decompresses instead of compressing.
Forgetting to specify the file name.
✗ Incorrect
The command 'gzip file.txt' compresses the file named file.txt, saving storage space.
2fill in blank
mediumComplete the command to decompress a gzip file.
Linux CLI
gzip [1] file.txt.gz Drag options to blanks, or click blank then click option'
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.
✗ Incorrect
The '-d' option tells gzip to decompress the file.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the uncompressed file name instead of the compressed one.
Mixing up file extensions.
✗ Incorrect
The '-l' option lists info about a gzip file, so the input must be the compressed file 'file.txt.gz'.
4fill in blank
hardFill 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'
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.
✗ Incorrect
The '-czf' option creates a compressed tar archive (resulting in archive.tar.gz), and 'ls -lh archive.tar.gz' checks its size.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to decompress before compressing.
Listing the wrong file name.
✗ Incorrect
First compress 'file.txt', then list the compressed file size, then decompress using '-d'.