pushd and popd

onethingwell:

A pair of very useful commands, pushd saves the current directory and (optionally) changes to a different one; popd returns you to the saved directory:

$ pwd
/home/you/directory
$ pushd /somewhere/far/away/in/the/filesystem
$ pwd
/somewhere/far/away/in/the/filesystem
$ cd /somewhere/else
$ cd /yet/another/place
$ popd
$ pwd
/home/you/directory