Enhancing cd using a stack

The command cd does not allow for a lot of customization, but there are two built-ins that can be used to extend the functionality of cd.

These are useful when you need to traverse a number of directories but need to return to your current location when done.

If you just need to toggle between two directories, then cd - will do the trick.