It's not possible to send to multiple remote locations with a single scp command. It can accommodate multiple source files but only one destination. Using just the scp command itself, it must be run twice.
scp file1 file2 [email protected]:/location1
scp file1 file2 [email protected]:/location2
It is possible to turn this into a "one-liner" by running a for loop. In bash for example:
for REMOTE in "[email protected]:/location1" "[email protected]:/location2"; do scp file1 file2 $REMOTE; done
scp still runs multiple times but the loop takes care of the iteration. That said, I find it easier to run the command once, hit the Up Arrow (which brings the original command back up in most environments) and just change the remote location and resend.
scponce and thenssha copy command... doesscporsftpactually have that ability built in, to command the remote computer to make a copy on itself? Of course, that does introduce a race condition,so you might actually copy over-the-network to a unique temporary location, then have the remote copy from there into all the desired destinations.scpis not a programming language.