222k views
3 votes
Which command creates a zip archive with all .txt files in the current directory?

a) zip -r archive.zip *.txt
b) create archive.zip -type txt
c) zip archive.zip -ext txt
d) compress -txt files -output archive.zip

User Fabiobh
by
7.5k points

1 Answer

5 votes

Final answer:

The command 'zip -r archive.zip *.txt' is used to create a zip archive of all .txt files in the current directory.

Step-by-step explanation:

The command to create a zip archive with all .txt files in the current directory is:

zip -r archive.zip *.txt

This command uses the 'zip' utility to compress the files. The '-r' flag is used for recursive processing to include files in subdirectories (if any), but in this case, it will compress all .txt files in the current directory into an archive named 'archive.zip'. None of the other options provided is a correct syntax for creating a zip file.

User Yogsma
by
7.5k points