Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-r' when not zipping directories.
Naming the archive with the wrong extension.
✗ Incorrect
The command 'zip archive.zip file.txt' creates a zip archive named archive.zip containing file.txt.
2fill in blank
mediumComplete the code to unzip the archive named data.zip.
Linux CLI
unzip [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-l' which only lists contents.
Using the wrong archive name.
✗ Incorrect
The command 'unzip data.zip' extracts the contents of data.zip in the current directory.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting '-r' when zipping folders.
Using '-x' which excludes files.
✗ Incorrect
The '-r' option tells zip to include files recursively, needed when zipping folders or multiple files.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which deletes files.
Using '-o' which overwrites without prompt.
✗ Incorrect
Use '-r' to recursively include files and '-x' to exclude files matching a pattern.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-x' which excludes files.
Omitting '-d' to specify extraction folder.
✗ Incorrect
The '-d' option specifies the target directory, and '-o' overwrites files without asking.