Exam 010-160 All QuestionsBrowse all questions from this exam
Question 38

A user is currently in the directory /home/user/Downloads/ and runs the command ls ../Documents/

Assuming it exists, which directory's content is displayed?

    Correct Answer: A

    When a user is in the directory /home/user/Downloads/ and runs the command ls ../Documents/, the command is listing the contents of the directory ../Documents/ relative to the user's current directory. The double dot (..) indicates moving up one level in the directory tree. Therefore, from /home/user/Downloads/, moving one level up brings the user to /home/user/. From there, the path ../Documents/ refers to /home/user/Documents/. Thus, the correct directory whose contents are displayed is /home/user/Documents/.

Discussion
jezdOption: A

A is the correct answer. From the directory /home/user/Downloads/ ../Documents is /home/user/Documents

harrymadgunOption: A

Shouldn't be A the right answer to this?

KITELinzOption: A

Did the Exam today, picked A and got 100%.

supergqOption: A

A is correct. The ".." changes into the child directory (i.e. /home/user), so "../Documents/" would list the contents of the /home/user/Documents directory.

shoshaOption: A

A is correct.

VslaughOption: A

Should be A

AndrewGrassoOption: A

The ls command is used to list the contents of a directory. When run with the argument ../Documents/, it will list the contents of the Documents directory that is located one level up from the current directory /home/user/Downloads/. Therefore, if the Documents directory exists in /home/user/, then option A, /home/user/Documents/, is the correct answer.

flavioamorimOption: A

A is the correct answer.

josephrmingOption: A

A is definitely the right answer

Dever24Option: A

A is correct

miurachOption: A

I tested this on my own VPS and the option A is the correct one.

Ness12Option: A

A is the right answer. .. = means go one folder back

hughesd010Option: A

It seems to be an almost interpretive question. Looking at strict notation the "/Documents/", D, answer would indicate a root level directory called "Documents" as there are NO preceding characters indicating it is a subdirectory. Like missing context in a text message.

Dor15Option: A

A is correct

TanchwaOption: D

So this is a dumb question, really. /home/user/Documents and /Documents/ (assuming its a directory in the same location one up from /Downloads/) is the same location, no doubt about it. However, the question asks about a directory's contents specifically. Technically, A. is a path, not a directory. D would be right if we take this into consideration, but in real life A and D would get you what you wanted.

MiragicoOption: A

A is the correct answer.

stressedout7Option: A

A is the correct answer.