Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SCP command to move directories from local machine to server

I am using a macbook air terminal (my local machine) to transfer over a directory with a large number of images onto a server. The images are located two subdirectores called "folder1" and "folder2" under /Users/viv/images/data. I want to copy the contents of this directory over to a server that I can ssh into. I ssh into it using the command ssh [email protected] My question is how do I copy the contents of my local machine onto the server, I tried using the following command:

scp -r /Users/viv/images/data [email protected]

But this ends up creating a new directory called udacity$54.91.119.34 and copying the contents of the data directory onto my local machine itself Please adice on how I should proceed so the data can be copied onto the server. Thanks in advance

like image 201
Veejay Avatar asked Aug 20 '17 02:08

Veejay


1 Answers

You need to add a colon at the end, followed by the destination directory (leave blank for the home directory of the user):

scp -r /Users/viv/images/data [email protected]:
like image 176
Christian Fritz Avatar answered Sep 28 '22 07:09

Christian Fritz