Recall & Review
beginner
What does the
zip command do in Linux?The
zip command compresses one or more files into a single archive file with a .zip extension. It helps save space and makes it easier to share multiple files together.Click to reveal answer
beginner
How do you extract files from a
.zip archive using the command line?Use the
unzip command followed by the archive name. For example, unzip archive.zip extracts all files from archive.zip into the current folder.Click to reveal answer
intermediate
What option do you use with
zip to include all files in a folder recursively?Use the
-r option with zip. For example, zip -r archive.zip foldername compresses the folder and all its contents, including subfolders.Click to reveal answer
beginner
How can you list the contents of a
.zip file without extracting it?Use
unzip -l archive.zip. This shows the list of files inside the archive without extracting them.Click to reveal answer
intermediate
What happens if you try to unzip a file into a folder where files with the same names already exist?
The
unzip command will ask if you want to overwrite each existing file. You can press y to overwrite or n to skip. Use the -o option to overwrite all without asking.Click to reveal answer
Which command compresses files into a .zip archive?
✗ Incorrect
The
zip command creates .zip archives. unzip extracts them.How do you extract all files from archive.zip?
✗ Incorrect
Use
unzip archive.zip to extract files from a .zip archive.What option with
zip includes all files in folders and subfolders?✗ Incorrect
The
-r option means recursive, including all subfolders.Which command lists files inside a zip archive without extracting?
✗ Incorrect
unzip -l lists contents of a zip archive.How to overwrite files automatically when unzipping?
✗ Incorrect
The
-o option overwrites existing files without asking.Explain how to create a zip archive of a folder including all its files and subfolders.
Think about compressing a whole folder recursively.
You got /4 concepts.
Describe how to safely extract files from a zip archive and check what files are inside before extracting.
Listing contents first helps avoid surprises.
You got /4 concepts.