Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

By default, directory symlinks on unix systems are treated as files as far as the autocomplete feature goes. For example, having a directory symlink at /srv/link/, typing /srv/liTAB does only complete to /srv/link, instead of more correct /srv/link/. That somewhat hinders my flow as it requires one more tab to go on writing the full path.

Anyway to automatically let the directory symlinks resolve?

share|improve this question
This seems to be true only in bash. Among perhaps others, it doesn't seem to be true in zsh. – Celada May 22 '12 at 16:59
I have to press tab twice for that. – cYrus May 22 '12 at 17:06
"More correct" is very subjective. I think the current way is logical. To remove a symlink by specifying it by tab completion, one would otherwise have to delete the trailing /, and it could be disastrous in a rm -r by accidentally cleaning the directory it points to instead of the symlink. Safe before sorry. My viewpoint doesn't invalidate your question in general, though, just a reflection. – Daniel Andersson May 22 '12 at 17:54
@DanielAndersson Oh, that did not occur to me. Though it's obviously not the common case, I have to agree it's way safer the way it is now that I come to think about it. Thanks for the insight. – Mikulas Dite May 22 '12 at 18:03
@Celada Hi there, could you please post your comment about different shells as an answer so I could mark this resolved? Thanks :) – Mikulas Dite Oct 4 '13 at 18:34
up vote 0 down vote accepted

As Celada pointed out in comments, different shells take different approaches to symlink autocompletion. I personally switched to zsh.

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.