How to copy a file from remote server to local machine?

omega picture omega · Mar 5, 2015 · Viewed 150.3k times · Source

In my terminal shell, I ssh'ed into a remote server, and I cd to the directory I want. Now in this directory, there is a file called table that I want to copy to my local machine /home/me/Desktop. How can I do this?

I tried scp table /home/me/Desktop but it gave an error about no such file or directory. Does anyone know how to do this?

Thanks

Answer

kkpoon picture kkpoon · Mar 5, 2015

For example, your remote host is example.com and remote login name is user1:

scp [email protected]:/path/to/file /path/to/store/file