System Management
An administrator is working in /var/log/nginx and then runs cd /etc/ssh. She needs to return to /var/log/nginx immediately, without retyping the path, and have the shell print the directory it switches to. Which command BEST accomplishes this?
Show the answer
Correct answerD. cd -
cd - switches to the previous working directory stored in OLDPWD and prints its path. cd ~ goes to the user's home directory, which is a different location, and cd .. would only move up to /etc.