Bash Change to the last directory


Example

For the current shell, this takes you to the previous directory that you were in, no matter where it was.

cd -

Doing it multiple times effectively "toggles" you being in the current directory or the previous one.