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.
Edit
Actually this problem did not show up for every directory, only one particular one, which I didn't realise when I asked. The cause of the problem is given in my answer to the question.