# A nice zsh feature I just discovered: dircectory stacks



## jrm@ (May 16, 2013)

```
% cd /var
% cd /var/db
% cd /var/db/pkg/
% cd /home/
% cd /home/jrm/
% cd /home/jrm/tmp/
% cd /home/jrm/tmp/blah
% cd -
0 -- /var
1 -- /var/db
2 -- /var/db/pkg
3 -- /home
4 -- /home/jrm
5 -- /home/jrm/tmp
```

Hitting tab after the `cd -` gives the list shown.

I found this tip here.


----------



## phoenix (May 16, 2013)

Hmmm, seems like a simpler/nicer version of push/pop in all sh-based shells.  Automatic is nice!


----------

