Andrew Janke wrote: > # go to wherever you were before > alias b="cd ${OLDPWD}" In bash and probably other shells, "cd -" is a built-in shorthand for "cd $OLDPWD". Also check out "pushd", "popd" and "dirs" which let you manage a stack of directories (so for example you could alias pushd as cd and then use popd as a multi-level back button).