Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to compress a file using bzip2.
Linux CLI
bzip2 [1] Drag options to blanks, or click blank then click option'
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.
✗ Incorrect
The command 'bzip2 file.txt' compresses the file named file.txt using bzip2.
2fill in blank
mediumComplete 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'
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.
✗ Incorrect
The '-d' option tells bzip2 to decompress the file.
3fill in blank
hardFix 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'
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.
✗ Incorrect
The '-k' option tells xz to keep the original file after compression. The 'xz' command compresses by default without needing '-z'.
4fill in blank
hardFill 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'
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.
✗ Incorrect
The '-d' option decompresses, and '-k' keeps the original file after decompression.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-xf' which extracts instead of creating or listing.
Mixing up options for tar and xz commands.
✗ Incorrect
Use '-cf' to create an archive, '-tf' to list contents, and '-z' to compress with xz.