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?
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.
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.
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.
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.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
jezd
Highly Voted 4 years agoharrymadgun
Highly Voted 4 years, 4 months agoVslaugh
Most Recent 1 week agoAndrewGrasso
7 months, 3 weeks agoflavioamorim
9 months, 1 week agojosephrming
1 year agosupergq
1 year, 1 month agoDever24
1 year, 3 months agomiurach
1 year, 4 months agoNess12
1 year, 7 months agoKITELinz
1 year, 9 months agohughesd010
1 year, 10 months agoDor15
2 years, 2 months agoTanchwa
2 years, 3 months agoMiragico
2 years, 3 months agostressedout7
2 years, 3 months agoshosha
2 years, 4 months ago