Copy files:
(1) Copy Local files to remote
SCP filename root@59.64.28.78: remote path
(2) Copy files from remote to local
SCP root@59.64.28.78: filename Local Path
Copy directory:
(1) Copy the local directory to the remote
Scp-r Directory name root@59.64.28.78: remote path
(2) from the remote directory back to the local
Scp-r root@59.64.28.78: Directory name local path.
Example
Copy remote files to local
SCP root@192.168.0.1:/home/database.php/var/www/database.php
Copy local files to another server
scp/var/www/database.php root@192.168.0.1:/home/database.php
Copy directory with the-r parameter, ssh non 22 port with the-p parameter.
Scp-p 2133-r root@192.168.0.1:/home/wwwroot//var/www/
scp-p 2133/var/www/root@192.168.0.1:/home/wwwroot/
Several parameters that may be useful:
-V is the same as the-V meaning in most Linux commands, and is used to show progress. Can be used to view connections, authentication, or configuration errors.
-C enables compression options.
-R passes all content under the directory.
-P Select the port. Note-P has been used by RCP.
-4 forcibly use IPV4 address.
-6 forcibly use IPV6 address.