How to copy a directory from local machine to remote machine

nish picture nish · Jul 24, 2013 · Viewed 67.5k times · Source

I am using ssh to connect to a remote machine.

Is there a way i can copy an entire directory from a local machine to the remote machine?

I found this link to do it the other way round i.e copying from remote machine to local machine.

Answer

Oliver Matthews picture Oliver Matthews · Jul 24, 2013

Easiest way is scp

scp -ra /path/to/local/storage [email protected]:/path/to/copy

rsync is best for when you want to update versions where it has been previously copied.

If that doesn't work, rerun with -v and see what the error is.