Multiple choice technology operating systems

What is the output of the following command? $ cd -

  1. change to home directory

  2. change directory to last directory as saved in the environment variable OLDPWD

  3. move to the last directory of that structure

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

cd - switches the shell back to the directory stored in OLDPWD and prints that path. It does not always go to the home directory; it specifically uses the previously saved location, making the selected option correct.