Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to compress the file named data.txt using gzip.
Linux CLI
gzip [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'gunzip' instead of the file name.
Using '-d' which is for decompressing.
Using '-c' without redirecting output.
✗ Incorrect
The command
gzip data.txt compresses the file data.txt and creates data.txt.gz.2fill in blank
mediumComplete the code to decompress the file archive.gz using gunzip.
Linux CLI
gunzip [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-c archive.gz' without redirecting output.
Using '-d' with gunzip (gunzip decompresses by default).
Using the uncompressed file name instead of the compressed one.
✗ Incorrect
The command
gunzip archive.gz decompresses the file archive.gz and restores archive.3fill in blank
hardFix the error in the command to decompress file.gz and output to stdout.
Linux CLI
gunzip [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the file name alone outputs to a file, not stdout.
Using '-d' is redundant with gunzip.
Using the uncompressed file name instead of the compressed one.
✗ Incorrect
The option
-c tells gunzip to decompress to standard output without removing the original file.4fill in blank
hardFill both blanks to create a gzip compressed file backup.gz from backup.txt and keep the original file.
Linux CLI
gzip [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which decompresses instead of compressing.
Using '-c' without redirecting output.
Not specifying the file name.
✗ Incorrect
The
-k option keeps the original file after compression. So gzip backup.txt -k compresses and keeps backup.txt.5fill in blank
hardFill all three blanks to decompress log.gz to log.txt without deleting the compressed file.
Linux CLI
gunzip [1] [2] > [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-k' with gunzip (not supported).
Not redirecting output, which deletes the original file.
Using the uncompressed file name as input.
✗ Incorrect
Using
gunzip -c log.gz > log.txt decompresses log.gz to log.txt and keeps the original compressed file.