Difficulty: Easy
Correct Answer: cd ..
Explanation:
Introduction / Context:
Command-line navigation relies on relative and absolute paths. Moving to the parent directory is a frequent task when traversing project trees or system hierarchies on UNIX-like systems.
Given Data / Assumptions:
cd
...
represents the parent directory in UNIX filepath semantics.
Concept / Approach:cd ..
instructs the shell to change into the directory referenced by ..
, which is the parent of the current working directory. This relative notation is consistent across UNIX shells (sh, bash, zsh, etc.).
Step-by-Step Solution:
Check current directory: pwd
.Execute cd ..
.Confirm new location with pwd
; path now reflects the parent directory.
Verification / Alternative check:
Use cd -
to jump back to the previous directory and verify movement. Use ls -a
to see the special entries .
(current) and ..
(parent).
Why Other Options Are Wrong:cd
alone goes to your home directory, not up one level.cd/
is not a standard UNIX idiom; cd /
(with a space) changes to root.chdir
may exist as a synonym on some systems, but without an argument it behaves like cd
and with an argument it requires ..
to target the parent; the canonical answer here is cd ..
.
Common Pitfalls:
cd ..
with cd ../..
, which goes up two levels.
Final Answer:
cd ..
Discussion & Comments