0
0
Linux CLIscripting~10 mins

gzip and gunzip in Linux CLI - Interactive Code Practice

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

Complete 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'
Adata.txt
B-d
Cgunzip
D-c
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'gunzip' instead of the file name.
Using '-d' which is for decompressing.
Using '-c' without redirecting output.
2fill in blank
medium

Complete the code to decompress the file archive.gz using gunzip.

Linux CLI
gunzip [1]
Drag options to blanks, or click blank then click option'
A-c archive.gz
Barchive.gz
C-d archive.gz
Darchive
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.
3fill in blank
hard

Fix 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'
Afile
Bfile.gz
C-d file.gz
D-c file.gz
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.
4fill in blank
hard

Fill 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'
A-k
Bbackup.txt
C-d
D-c
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which decompresses instead of compressing.
Using '-c' without redirecting output.
Not specifying the file name.
5fill in blank
hard

Fill 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'
A-c
Blog.gz
Clog.txt
D-k
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.