Quick Tip – copying colons over ssh and rsync

Nov 19 2013 Published by under tech

If you happen to want to copy a file in the current directory with a colon in the name:

this will fail. Possibly after quite a timeout, with a completely unrelated error (unresolved domain name some-file maybe?)

This is because ssh uses colons to separate the user@host part from the filename part.

The fix when the source is on the local computer is to ensure the path starts with a dot:

Incidentally this is related to that old newby fail, forgetting the trailing colon when coping to a destination home directory:

results in a file in the current directory called ‘user@host’. Oops!

Be Sociable, Share!
Tags:

No responses yet