Challenge - 5 Problems
Zip Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of listing files after zipping?
You have a directory with files:
file1.txt, file2.txt, and file3.txt. You run the command zip archive.zip file1.txt file2.txt. Then you run ls archive.zip. What is the output?Linux CLI
zip archive.zip file1.txt file2.txt ls archive.zip
Attempts:
2 left
💡 Hint
The
ls command lists files and directories by name.✗ Incorrect
The
zip command creates a compressed file named archive.zip. The ls archive.zip command lists that file by its name only.💻 Command Output
intermediate2:00remaining
What happens when you unzip a file into a directory?
You have a zip file named
docs.zip containing files readme.md and guide.pdf. You run unzip docs.zip -d extracted_docs. What will be the result?Linux CLI
unzip docs.zip -d extracted_docs
ls extracted_docsAttempts:
2 left
💡 Hint
The
-d option specifies the directory to extract files into.✗ Incorrect
The unzip command extracts the contents of docs.zip into the directory extracted_docs. Listing that directory shows the extracted files.
📝 Syntax
advanced2:00remaining
Which command correctly creates a zip archive including all files in a directory?
You want to create a zip file named
backup.zip that contains all files inside the directory project. Which command is correct?Attempts:
2 left
💡 Hint
The
-r option means recursive, to include directories and their contents.✗ Incorrect
Option A uses
-r correctly to include the entire project directory recursively. Option A only includes files in project root, not subdirectories. Option A has wrong option order. Option A includes only the directory entry, not contents.🔧 Debug
advanced2:00remaining
Why does this unzip command fail with 'cannot find or open' error?
You run the command
unzip myfiles.zip -d /home/user/docs but get the error: cannot find or open myfiles.zip, myfiles.zip.zip or myfiles.zip.ZIP. What is the likely cause?Linux CLI
unzip myfiles.zip -d /home/user/docsAttempts:
2 left
💡 Hint
Check if the zip file is in the current folder where you run the command.
✗ Incorrect
The error means unzip cannot find the zip file to open. This usually happens if the file is missing or the path is wrong. The -d option and permissions are not the cause here.
🚀 Application
expert3:00remaining
How to create a zip archive excluding certain file types?
You want to zip all files in the current directory but exclude all
.log files. Which command achieves this?Attempts:
2 left
💡 Hint
The
-x option excludes files matching a pattern.✗ Incorrect
Option C correctly uses
-r for recursion and -x '*.log' to exclude .log files. Other options use invalid or unsupported flags.