I have used pushd to move about to various directories and now if I rundirs -vI get: 0  ~/Desktop 1  /etc 2  /var/log 3  ~/Downloads 4  /tmpHow can I popd to a specific directory in the middle of the stack?, e.g option 2: /var/logman 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 +3And 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? 
How can I popd to a specific directory?
bash;pushd
cd `dirs +<number>`where <number> is 0 or 3 or something else.In any case, I recommend you check out a cd wrapper such as http://davidcorne.com/tag/cd/ , which pushes onto the dir stack in the background and allows you to do cd -- instead of dirs -v and cd -<number> to get you into the directory you want. It also replaces initial tildas with $HOME, eliminating the problem you've alluded to in the comments.