» Linux » Examen sur Linux » Examen 201 : Advanced Administration » Section 2 » Question 9/20
9.You are covering for another system administrator and one of the users asks you to restore a file for him. You locate the correct tarfile by checking the backup log but you do not know how the directory structure was stored. What command can you use to determine this?

tar fx tarfile dirname
tar tvf tarfile filename
tar ctf tarfile
tar tvf tarfile

Explanation: You can list the contents of a 'tarball' with the tar tvf tarfile command. The t option is used to list the files and directories. The v option runs the command in verbose mode. The f option allows you to specify the name of the tarball (a tarball is a common name for an archive created with the tar utility) with the f <filename> option.

Reference: http://www.oreillynet.com/linux/cmd/t/tar.html

Incorrect Answers
A: The syntax of this command is wrong. The x must come before the f. This also does not list the contents of the file.
B: This command would list the path to 'filename'. Although this would be required information to restore a file, the question states that you want to view the directory structure.
C: The c option is used to create a tarball which isn't required in this question.

« Question 8 Question 10 »