Say I do the following:
cd ~
pushd .
cd /bin/
pushd .
dirs
"/bin/ ~/
cd ~/Downloads/
pushd .
dirs
~/Downloads /bin/ ~"
How would I popd back to something a while ago, say from downloads to the home directory~?
Depending on your shell, for zsh you can just use cd -N to change to your Nth previous directory.
For bash you can use for example dirs to get a directory name. You can use that to do something like cd "$(dirs -N)" which will go the the Nth previous directory, just like the zsh example above.
popd 2to go to something that Ipushd'd two times ago? – user73959 Jul 02 '14 at 02:27