How to move a folder from one Linux server to another using SCP

In some cases we will have to move whole folders or files from one server to another. its not always practical to download the file and upload it to the new location. If you are dealing with a VPS server and you have the shell access on both the systems, you can use SCP command to do this. Command for this is as follows :

scp -r <username>@<ip_number or address>:<location of the folder or file to be copied> <location to which the file or folder must be copied>

In the above command <username> stands for a valid user in the source server, <ip_number or address> this is the ip number or host address of the source server where the file or folder is located.<location of the folder or file to be copied> this is the location from which the file or folder should be copied. space must be provided. Then <location to which the file or folder must be copied> this is the location to which the file or folder must be copied.

After this steps you will be prompted with a password prompt where you will have to enter the password of the source server, once you have entered the password and the password is correct. File transfer begins and after copy prompt will automatically move to the next prompt line. You can see the folder at the destination location which is at <location to which the file or folder must be copied>.