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?
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?
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/.
A is the correct answer. From the directory /home/user/Downloads/ ../Documents is /home/user/Documents
Shouldn't be A the right answer to this?
Did the Exam today, picked A and got 100%.
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.
A is correct.
Should be 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.
A is the correct answer.
A is definitely the right answer
A is correct
I tested this on my own VPS and the option A is the correct one.
A is the right answer. .. = means go one folder back
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.
A is correct
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 is the correct answer.
A is the correct answer.