When you're spending a part of your life on the commandline, you'r probably cd'ing a lot in and out directories. Some handy commands (for bash):
-
cd(without arguments) brings you to your home directory -
cd -(with just a minus) brings you to the previous directory you went to withcd -
pushdworks likecdbut stores it argument on a stack.popdpops the last directory from that stack and goes back to the previous directory on the stack. Withdirsyou can view your current directory stack (which dopopdandpushdtoo). That way you can go back in your directory visitation round.
As an example:
/home/foobear $> pushd work/bee/wellohorld ~/work/bee/wellohorld ~ /home/foobear/work/bee/welloworld $> pushd ~/tmp/ ~/work/bee/tmp ~/work/bee/welloworld ~ /home/foobear/tmp $> pushd /etc/ /etc ~/work/bee/tmp ~/work/bee/welloworld ~ /etc $> popd ~/work/bee/tmp ~/work/bee/welloworld ~ /home/foobear/tmp $> pushd ~/work/bee/wellohorld ~ /home/foobear $>