Linux Learning notes in the SCP command detailed

Source: Internet
Author: User

The SCP is the command for remote file copies under the Linux system based on SSH login.

There are two kinds, one is from local to remote, the other is from remote to local.

1. From local to remote

File copy:

The code is as follows Copy Code

SCP Local_file Remote_user@remote_ip:remote_file

Catalog copy:

The code is as follows Copy Code

Scp-r Local_folder Remote_user@remote_ip:remote_folder

2. From remote to local

File copy:

The code is as follows Copy Code

SCP Remote_user@remote_ip:remote_file Local_file

Example:

The code is as follows Copy Code

Scp/home/space/music/1.mp3 Root@www.cumt.edu.cn:/home/root/others/music
Scp/home/space/music/1.mp3 Root@www.cumt.edu.cn:/home/root/others/music/001.mp3
Scp/home/space/music/1.mp3 Www.cumt.edu.cn:/home/root/others/music
Scp/home/space/music/1.mp3 Www.cumt.edu.cn:/home/root/others/music/001.mp3

Catalog copy:

The code is as follows Copy Code

Scp-r Remote_user@remote_ip:remote_folder Local_folder

Example:

The code is as follows Copy Code

Scp-r/home/space/music/root@www.cumt.edu.cn:/home/root/others/
Scp-r/home/space/music/www.cumt.edu.cn:/home/root/others/

The above command copies the local music directory to the remote others directory, which is remotely available after replication. /others/music/Directory

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.