Next: Repeating and editing previous
Up: Customizing your shell and
Previous: Customizing ls
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. Of course, if you just
need to toggle between two directories, then cd
pushd <new_dir> will push the current directory onto the
directory stack and cd to the new directory. This can be
aliased as alias pd=pushd.
popd is the corresponding pop operation. This will pop the top
directory on the stack and cd to it. This can be aliased as
- will do the