Problem 3 (12 points): Answer the following questions about the ‘.’ and ‘..’ dir
ID: 3849294 • Letter: P
Question
Problem 3 (12 points): Answer the following questions about the ‘.’ and ‘..’ directories assuming you are currently in the /a/b/c/d/ directory for each question:
a) What specific directory does ‘..’ refer to (in this case)?
b) What specific directory does ‘.’ refer to (in this case)?
c) If you were to run the command cd ../../xyz , what would be the new current working directory?
d) If you were to run the command cd ./e , what would be the new current working directory?
e) Are the ‘.’ and ‘..’ directories considered to be visible or hidden? Why?
f) What is the difference between the ‘.’ and ‘..’ directories?
Explanation / Answer
a) .. refers to parent directory. In our case d is the present directory, so .. refers to c directory as it is parent directory to d.
b) . refers to current directory. So it refers to d directory.
c) He is presently in /a/b/c/d/ directory, after running the given command cd ../../xyz. He will be in /a/b/xyz.
d) /a/b/c/d/e is his new current working directory after running cd ./e.
e) Hidden
Hidden filesystem objects are not listed by default when using the ls command (which is commonly employed to list the items in a directory). However, they can easily be made to appear by adding the -a option. These directories are by default prsent in every directory that we navigate.
f) . reprsents current directory whereas .. represents parent directory.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.