0
0
Linux CLIscripting~10 mins

zip and unzip 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 create a zip archive named archive.zip from the file file.txt.

Linux CLI
zip [1] file.txt
Drag options to blanks, or click blank then click option'
Afile.zip
B-r archive.zip
C-x archive.zip
Darchive.zip
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-r' when not zipping directories.
Naming the archive with the wrong extension.
2fill in blank
medium

Complete the code to unzip the archive named data.zip.

Linux CLI
unzip [1]
Drag options to blanks, or click blank then click option'
Aarchive.zip
Bdata.zip
C-d data.zip
D-l data.zip
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-l' which only lists contents.
Using the wrong archive name.
3fill in blank
hard

Fix the error in the command to zip all files in the folder docs into docs.zip.

Linux CLI
zip [1] docs/*
Drag options to blanks, or click blank then click option'
A-r docs.zip
Bdocs.zip
C-x docs.zip
D-d docs.zip
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting '-r' when zipping folders.
Using '-x' which excludes files.
4fill in blank
hard

Fill both blanks to create a zip archive named backup.zip including all .txt files and exclude all .log files.

Linux CLI
zip [1] *.txt [2] '*.log'
Drag options to blanks, or click blank then click option'
A-r backup.zip
B-x
C-d
D-o
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which deletes files.
Using '-o' which overwrites without prompt.
5fill in blank
hard

Fill all three blanks to unzip archive.zip into the folder extracted, overwriting existing files without prompting.

Linux CLI
unzip [1] -d [2] [3]
Drag options to blanks, or click blank then click option'
Aarchive.zip
Bextracted
C-o
D-x
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-x' which excludes files.
Omitting '-d' to specify extraction folder.