I have often found myself moving from directory to directory on my Linux box, and then sighing at not remembering what directory I was in before.
However, as I recently discovered, there are two commands to prevent this.
Pushd allows you to specify the directory your about to move into. The syntax is exactly the same as cd, ie: pushd /anydir/anylocation/.
Popd allows you to jump directly back to the directory you just push'd from. The syntax is simply popd
Another way of going back to the last directory is to cd -
About the author, Owen Kelly.