Linux->> SCP command to copy files/folders on the peer machine

Source: Internet
Author: User
Tags scp command secure copy

The SCP is a shorthand for secure copy, which is used to copy files from a remote machine under Linux.

Characteristics:

The transmission is encrypted and slightly affects the speed. Compared with rsync, it has an advantage over resource occupancy.

Usage

SCP [parameter] [original path] [Target path]

Parameters

-C Compression

-P retains the original file's modification time, access time, and access rights.

-Q does not display the transfer progress bar.

-R recursively replicates the entire directory.

-V verbose displays the output. SCP and SSH (1) will display debugging information for the entire process. This information is used to debug connections, authentication, and configuration issues.

-L Limit

-P Specify the transport port

Example:

Copy files locally to the remote machine:

Command format:

SCP Local_file [Email Protected]_ip:remote_folder

Or

SCP Local_file [Email protected]_ip:remote_file

Or

SCP Local_file Remote_ip:remote_folder

Or

SCP Local_file Remote_ip:remote_file

Copy directories locally to the remote machine:

Command format:

Scp-r Local_folder [Email protected]_ip:remote_folder

Or

Scp-r Local_folder Remote_ip:remote_folder

To copy a directory from a remote machine to a local server:

SCP [Email protected]:/opt/soft/nginx-0.5.38.tar.gz/opt/soft/

[Email protected]:/run/network$SCP[Email protected]192.168.2.100:/home/jerry/download/jdk-8u65-linux-x64.Tar. GZ ~The authenticity of host'192.168.2.100 (192.168.2.100)'Can't be established.ECDSA key fingerprint is da:b7:c3:2a:ea:a2: the: 4c:c3:c1: the: Ca:0e:c2:ea: the. Is you sure want to continue connecting (yes/no)?Yeswarning:permanently added'192.168.2.100'(ECDSA) to the list of known hosts. [Email protected]192.168.2.100's Password:SCP:/home/jerry/download/jdk-8u65-linux-x64.Tar. Gz:no suchfileor Directory[email protected]:/run/network$SCP[Email protected]192.168.2.100:/home/jerry/downloads/jdk-8u65-linux-x64.Tar. GZ ~[email protected]192.168.2.100's Password:Jdk-8u65-linux-x64.Tar. gz -% 173MB +.6mb/sxx: ,[email protected]:/run/network$

Reference:

One Linux command per day: SCP command

Linux->> SCP command to copy files/folders on the peer machine

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: info-contact@alibabacloud.com 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.