Skip to content

Instantly share code, notes, and snippets.

@AndreCAndersen
Created July 15, 2017 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreCAndersen/a102ec73ab399505736d8926848ae6a5 to your computer and use it in GitHub Desktop.
Save AndreCAndersen/a102ec73ab399505736d8926848ae6a5 to your computer and use it in GitHub Desktop.
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