010-160 Exam QuestionsBrowse all questions from this exam

010-160 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?

Show Answer
Correct Answer: AD

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

17 comments
Sign in to comment
jezdOption: A
May 19, 2020

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

harrymadgunOption: A
Jan 30, 2020

Shouldn't be A the right answer to this?

KITELinzOption: A
Sep 11, 2022

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

shoshaOption: A
Jan 17, 2022

A is correct.

supergqOption: A
May 7, 2023

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.

flavioamorimOption: A
Sep 8, 2023

A is the correct answer.

AndrewGrassoOption: A
Oct 23, 2023

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.

VslaughOption: A
Jun 4, 2024

Should be A

stressedout7Option: A
Mar 3, 2022

A is the correct answer.

MiragicoOption: A
Mar 5, 2022

A is the correct answer.

TanchwaOption: D
Mar 10, 2022

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.

Dor15Option: A
Apr 13, 2022

A is correct

hughesd010Option: A
Aug 5, 2022

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.

Ness12Option: A
Nov 14, 2022

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

miurachOption: A
Jan 16, 2023

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

Dever24Option: A
Feb 18, 2023

A is correct

josephrmingOption: A
Jun 2, 2023

A is definitely the right answer