Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 010-160 Exam - Topic 3 Question 70 Discussion

Posted by Quiana on Jul 21, 2026 at 11:07 AM

Which of the following commands creates the ZIP archive poems.zip containing all files in the current directory whose names end in .txt?

Suggested Answer: C

The zip command is used to create compressed archive files that can contain one or more files or directories. The zip command takes the name of the archive file as the first argument, followed by the names of the files or directories to be included in the archive. You can also use wildcards to match multiple files or directories with a common pattern. For example, the command zip poems.zip *.txt will create the ZIP archive poems.zip containing all files in the current directory whose names end in .txt. The other commands are either invalid or do not perform the desired operation. The command zip *.txt > poems.zip will try to create an archive for each file ending in .txt and redirect the output to poems.zip, which is not a valid archive file. The command zcat *.txt poems.zip will try to decompress and concatenate the contents of the files ending in .txt and poems.zip, which is not a valid ZIP file. The command zip cfz poems.zip *.txt will fail because the options c, f, and z are not valid for the zip command. The command cat *.txt | zip poems.zip will try to read the contents of the files ending in .txt from the standard input and create an archive named poems.zip, but this will not preserve the file names or attributes of the original files.Reference:

Linux Essentials - Linux Professional Institute (LPI), section 3.1.1

3.1 Archiving Files on the Command Line - Linux Professional Institute Certification Programs, slide


Get Premium 010-160 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
15 comments · newest first
SH
Sheridan 18 days ago
E is just using cat, not the best choice.
VE
Veda 23 days ago
D is too complex for this question.
VI
Vinnie 28 days ago
Right! A looks confusing with the output redirection.
SH
Sheridan 1 month ago
C makes sense, it specifies the archive name first.
VE
Veda 1 month ago
I feel like A could be a trick.
VI
Vinnie 1 month ago
I think it's C. Seems straightforward.
DY
Dyan 2 months ago
Definitely C, no doubt about it!
WI
Wilda 2 months ago
Wait, can you really use cat with zip?
KA
Kayleigh 2 months ago
D doesn't seem correct to me.
VA
Vanna 2 months ago
I thought it was A at first.
EL
Elfrieda 2 months ago
C is the right answer!
VE
Verlene 2 months ago
I have a feeling that option D might be incorrect since it adds extra flags that I don't think are necessary for just creating a ZIP file.
FE
Felice 3 months ago
I'm a bit confused about the syntax; I feel like "zip *.txt > poems.zip" doesn't seem right, but I can't recall why.
SA
Samira 3 months ago
I remember practicing a similar question, and I think option C is correct because it specifies the output file first.
TR
Tresa 3 months ago
I think the command should be something like "zip poems.zip *.txt", but I'm not entirely sure if the order matters.
0/2000 characters

Save Cancel