The command cd ./../.:
2019
The command cd ./../.:
Answer: B. is equivalent to cd ... — ConceptIn a shell pathname, . denotes the current directory and .. denotes its parent directory. Path components are resolved in sequence; a trailing . keeps…
- A.
serves no purpose.
- B.
is equivalent to
cd ... - C.
is invalid.
- D.
None of these
Show answer & explanation
Correct answer: B
Concept
In a shell pathname, . denotes the current directory and .. denotes its parent directory.
Path components are resolved in sequence; a trailing . keeps the directory reached at that point unchanged.
Application
The initial
./starts from the current working directory.The
..component moves pathname resolution to the parent directory.The final
.denotes that same parent directory, so it adds no further movement.The
cdcommand changes the working directory to that resolved parent path.
Cross-check
Starting at /home/user/docs, the path resolves as /home/user/docs → /home/user → /home/user. This is the same destination produced by cd ...
Contrast
“serves no purpose” does not fit because the working directory changes from the current directory to its parent.
“is invalid” does not fit because
.,.., and/are valid pathname components or separators.“None of these” does not fit because equivalence with
cd ..is one of the listed descriptions.
Therefore, cd ./../. is equivalent to cd ...