The use of the Linux SCP command to copy transfer files

Source: Internet
Author: User
Tags scp command

The SCP command is for users to copy files from one Linux server to another Linux server over the network, as follows:

One: Copy from local to remote

To copy a file:

Command format: SCP local_file [Email Protected]_ip:remote_folder

Example:

Scp/home/space/music/1.mp3 [Email Protected]:/home/root/others/music

Scp/home/space/music/1.mp3 [Email Protected]:/home/root/others/music/001.mp3

Scp/home/space/music/1.mp3 Www.xxx.xxx.cn:/home/root/others/music

Scp/home/space/music/1.mp3 Www.xxx.xxx.cn:/home/root/others/music/001.mp3

To copy a directory:

Command format: scp-r local_folder [Email protected]_ip:remote_folder

or Scp-r Local_folder Remote_ip:remote_folder

Example:

Scp-r/home/space/music/[Email protected]:/home/root/others/

Scp-r/home/space/music/www.xxx.xxx.cn:/home/root/others/

The above command is to copy the local music directory to the remote others directory, which is available on the remote server after replication: /others/music/Directory

Two: From remote replication to local

From the remote copy to local, as long as the copy from the local to the remote command after the 2 parameters of the switch shun;

For example:

SCP [Email Protected]:/home/root/others/music/home/space/music/1.mp3

Scp-r www.xxx.xxx.cn:/home/root/others//home/space/music/

The use of the Linux SCP command to copy transfer files

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.