I'd like to copy a single file through an scp command such that the folder ./a will be transferred to some remote directory as {a1, a2, a3}. In other words, I want multiple copies of a single file.

Here's an example:

scp -r a/ 'user@server:~/Data/{a1, a2, a3}'
scp: ambiguous target

1 Answer 1


As with the cp command, you can't copy a file or directory to multiple places with a single invocation. Instead, transfer the file or directory over and then make copies of it remotely:

scp -r a user@server:Data/a1
ssh user@server 'cd Data && cp -r a1 a2 && cp -r a1 a3'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .