Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on Zsh 5.0.2 (latest stable version), and I noticed that:

dirs -v


cd -<TAB>

show a different list of directories (or at least directories in different order).

Moreover, it seems as if cd - shows oldest directories at the top, with the more recent directories at the bottom (exactly the opposite of what I want)

Why are these lists different, and how can I change the options of these lists?

share|improve this question
up vote 4 down vote accepted

You are moving from the right(to left) of the directory stack when using -. where as dirs -v prints the directory stack,in a list, from the left(to right). If you were to cd +<TAB> the completion would show in the same order as dirs -v. Using dirs without options, would give a more accurate visual representation of the stack and how you are rotating it with pushd & popd. If the pushd_minus option is set, the context of - and + are swapped. man zshbuiltins and look for pushd for more information.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.