Linux under SCP command implementation File Replication example

Source: Internet
Author: User
Tags scp command

Copy files:

(1) Copy Local files to remote

SCP filename root@ remote path

(2) Copy files from remote to local

SCP root@ filename Local Path

Copy directory:

(1) Copy the local directory to the remote

Scp-r Directory name root@ remote path

(2) from the remote directory back to the local

Scp-r root@ Directory name local path.


Copy remote files to local

SCP root@

Copy local files to another server

scp/var/www/database.php root@

Copy directory with the-r parameter, ssh non 22 port with the-p parameter.

Scp-p 2133-r root@

scp-p 2133/var/www/root@

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.