Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.
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.
I just recreated this exact scenario on my Linux machine today 9/3/2021 and it is 100% confirmed that the command "ls ../Documents/" returns the contents of "home/user/Documents"
So, A would be the correct answer. 100% confirmed.
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 3 years, 11 months agoharrymadgun
Highly Voted 4 years, 2 months agoAndrewGrasso
Most Recent 6 months agoflavioamorim
7 months, 2 weeks agojosephrming
10 months, 3 weeks agosupergq
11 months, 3 weeks agoDever24
1 year, 2 months agomiurach
1 year, 3 months agoNess12
1 year, 5 months agoKITELinz
1 year, 7 months agohughesd010
1 year, 8 months agoDor15
2 years agoTanchwa
2 years, 1 month agoMiragico
2 years, 1 month agostressedout7
2 years, 1 month agoshosha
2 years, 3 months agoJRossJ
2 years, 7 months ago