How to change back to previous path quickly?

The command cd - will allow you to quickly return to the last directory.

You may also be interested in the pushd and popd commands which allow even more control over your directory navigation.


Depending on the shell you use, there's usually a variable with the previous working directory. In bash, I believe it's $OLDPWD