Take the 2-minute tour ×

This command does nothing.

scp doc.txt user@mywebsite.com

This command, however, copies doc.txt into the home directory of my website.

scp doc.txt user@mywebsite.com:

Why doesn't the first command (without a colon) work?

share|improve this question
You're wrong about the first command. It in fact does something: copies doc.txt to user@mywebsite.com. –  criziot Jul 15 '12 at 0:57
To clarify why you get downvotes on your question: it does not show any "research effort" which is required on this site, inasmuch as reading man scp would have given you the answer. –  Daniel Andersson Jul 15 '12 at 14:08

3 Answers 3

up vote 5 down vote accepted

According to the man page for scp:


The host needs a colon to indicate that it's remote.

share|improve this answer

scp can be used locally. The colon is how it distinguishes between a local copy and a remote copy. BTW that first one probably does something - copy doc.txt to a file called "user@mywebsite.com"

share|improve this answer

The name user@mywebsite.com is a valid name on the local filesystem. scp like rcp before it uses the colon character to seperate the remote user and hostname from the remote path.

Or to put it differently, that is just the way the program was written.

share|improve this answer

Your Answer


