Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to copy all files from a directory to a remote directory using scp?
andre@andersen:~$ mkdir scptest
andre@andersen:~$ mkdir scptarget
andre@andersen:~$ cd scptest/
andre@andersen:~/scptest$ touch temp1
andre@andersen:~/scptest$ touch temp2
andre@andersen:~/scptest$ scp ~/scptest/* andre@localhost ~/scptarget
cp: cannot stat ‘andre@localhost’: No such file or directory
andre@andersen:~/scptest$ scp ~/scptest/* andre@localhost:~/scptarget
andre@localhost's password: REDACTED
temp1 100% 0 0.0KB/s 00:00
temp2 100% 0 0.0KB/s 00:00
andre@andersen:~/scptest$ ls ../scptarget/
temp1 temp2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment