This article will show you how you can transfer files between two servers. It doesn’t matter how large files are, between servers you can transfer file of any size. Whether it’s too big file or too small.
You have to login to your server using SSH and then follow below listed commands as per your requirement. So, connect your web server with putty and get to the ssh terminal. Following are some scp commands which can be used. In this commands change path according to your directory.
I will be using scp command to transfer files.
scp stands for Secure Copy, it’s used for copying file from local to remote server and vice versa.
It uses ssh for data transfer and provides the same authentication and same level of security as ssh.
We can transfer files from
- local to remote machine
- remote to local machine
- remote to remote machine
Copy the file “myfile.zip” from a remote host to a the local host
$ scp [email protected]:myfile.zip /some/local/directory
Copy the file “myfile.zip” from the local host to a remote host
$ scp myfile.zip [email protected]:/some/local/directory
Copy the file “myfile.zip” from the local host to a remote host using port 2264
$ scp -P 2264 myfile.zip [email protected]:/some/remote/directory
Copying the files “foo.txt” and “bar.txt” from the local host to your home directory on the remote host
$ scp foo.txt bar.txt [email protected]:~
Copy multiple files from the remote host to your current directory on the local host
$ scp [email protected]:/some/remote/directory/\{a,b,c\} .
$ scp [email protected]:~/\{foo.txt,bar.txt\} .
Copy the file “myfile1.zip” from remote host “remote1.com” to remote host “remot2.com”
$ scp [email protected]:/some/remote/directory/myfile.zip \ [email protected]:/some/remote/directory/