PrepAway - Latest Free Exam Questions & Answers

Which of the following commands will you use to accomplish the task?

You work as a network administrator for company Inc. The company has a Linux-based network.
You want to create a file named foobar.zip and put it into a directory named filesdir. Which of the
following commands will you use to accomplish the task?

PrepAway - Latest Free Exam Questions & Answers

A.
unzip foobar.zip filesdir

B.
zip -r foobar.zip filesdir

C.
tar -tvf foobar.tar

D.
gunzip foobar.zip

Explanation:

The zip -r foobar.zip filesdir command is used to create a file named foobar.zip and put it into the
directory named filesdir. foobar.zip represents the file you are creating and filesdir represents the
directory you want to put in the new zip file. The -r option specifies that you want to include all files
contained in the filesdir directory recursively.
Answer option A is incorrect. The unzip foobar.zip command is used to extract the contents of a
zip file to the filesdir directory.
Answer option D is incorrect. The gunzip foobar.zip command is used to expand the compressed
file.
Answer option C is incorrect. The tar -tvf foobar.tar command is used to list the contents of a tar
file.


Leave a Reply