0
0
Linux CLIscripting~10 mins

bzip2 and xz compression 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 a file using bzip2.

Linux CLI
bzip2 [1]
Drag options to blanks, or click blank then click option'
A-d
B-k
Cfile.txt
D-x
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which is for decompression.
Using '-k' which keeps the original file but is optional.
Using '-x' which is not a valid bzip2 option.
2fill in blank
medium

Complete the code to decompress a .bz2 file using bzip2.

Linux CLI
bzip2 [1] file.bz2
Drag options to blanks, or click blank then click option'
A-k
B-d
C-c
D-x
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-k' which keeps the original file but does not decompress.
Using '-c' which outputs to stdout but does not decompress by itself.
Using '-x' which is not a valid bzip2 option.
3fill in blank
hard

Fix the error in the command to compress a file using xz.

Linux CLI
xz [1] file.txt
Drag options to blanks, or click blank then click option'
A-k
B-c
C-d
D-z
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which decompresses instead of compressing.
Using '-z' which is not a valid xz option for compression (xz compresses by default).
Using '-c' which outputs to stdout but does not compress by itself.
4fill in blank
hard

Fill both blanks to decompress a file and keep the original using xz.

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

Fill all three blanks to create a compressed archive with xz and list its contents.

Linux CLI
tar [1] archive.tar.xz [2] | xz [3] > archive.tar.xz
Drag options to blanks, or click blank then click option'
A-cf
B-tf
C-z
D-xf
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-xf' which extracts instead of creating or listing.
Mixing up options for tar and xz commands.