I have used pushd to move about to various directories and now if I run
dirs -v
I get:
0 ~/Desktop
1 /etc
2 /var/log
3 ~/Downloads
4 /tmp
How can I popd to a specific directory in the middle of the stack?, e.g option 2: /var/log
man bash says
+n Removes the nth entry counting from the left of the list shown
by dirs, starting with zero. For example: ``popd +0'' removes the
first directory, ``popd +1'' the second.
I've tried
- ``popd +0''
- popd +3
And it pops the correct directory off the stack, but doesn't change the current working directory.
How can I popd the particular directory and change the current working directory to the "popped" dir?