On Linux, why does directory tab completion add a \ to a path starting with ~

Posted by crobar on Super User See other posts from Super User or by crobar
Published on 2012-10-27T09:55:21Z Indexed on 2012/10/27 11:06 UTC
Read the original article Hit count: 332

On my work scientific linux 6.2 machine, I often start typing in a directory like below and use tab completion to finish it:

~/mydir

But when I hit tab, it becomes e.g.

\~/mydirectory/

With an extra forward slash at the start. Why is this, and can I prevent it? It's a pain because using cd etc. doesn't work with the extra slash, I have to start from the actual home directory which is something like

/home/username/

On these PCs.

© Super User or respective owner

Related posts about terminal

Related posts about directory