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

Say I have a folder parent with a subfolder, subfolder and a symbolic link symbolic_link.

I noticed that if my current working directory subfolder and I try to do cd ../sym[TAB], it will not autocomplete to cd ../symbolic_link.

How can I enable this type of autocompletion in Zsh?

share|improve this question
up vote 2 down vote accepted

zsh will autocomplete a symlink for cd if it points to a valid directory.

parent $ ls -l ../symbolic_link 
lrwxrwxrwx 1 e users 1 Jan 30 23:19 ../symbolic_link -> /
parent $ cd ../symbolic_link/
                 ^^ [TAB] pressed here
parent $ ln -s /asdf ../wrong_symbolic_link
parent $ cd ../wr
                 ^^ [TAB] sound the bell here
share|improve this answer
Hmm, I wonder if the reason why it doesn't work for me is because my symlinks point to paths mounted on different machines on the network. It's certainly not working for me (working with ZSH 5.02) – Amelio Vazquez-Reina Jan 30 '13 at 22:24
zsh 5.0.2 here and completion works with symbolic links pointing to directories on nfs and sshfs shares. – Endre Szabo Jan 30 '13 at 22:27
Thanks a lot Endre ... I will investigate this on my side. It looks like it works in some places for me too. hmm – Amelio Vazquez-Reina Jan 30 '13 at 22:30

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.