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…

  1. A.

    serves no purpose.

  2. B.

    is equivalent to cd ...

  3. C.

    is invalid.

  4. 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

  1. The initial ./ starts from the current working directory.

  2. The .. component moves pathname resolution to the parent directory.

  3. The final . denotes that same parent directory, so it adds no further movement.

  4. The cd command 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 ...

Explore the full course: Up Police Computer Operator

Loading lesson…