File transfer between Linux (SCP)

Source: Internet
Author: User
Tags scp command

SCP command for Linux

The SCP command of Linux can be used to copy files and directories between Linux;

==================
SCP command
==================
SCP can copy files between 2 Linux hosts;

Command basic format:

SCP [Optional parameters] File_source File_target

======
Copy from local to remote
======
* Copy files:
* 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

1th, 2 Specify the user name, command execution after the need to enter the password, the 1th only specifies the remote directory, the file name is unchanged, 2nd specified the file name;
3rd, 4 does not specify a user name, command execution after the need to enter a user name and password, the 3rd only specifies the remote directory, the file name is unchanged, 4th specified the file name;
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.cumt.edu.cn:/home/root/others/music
Scp/home/space/music/1.mp3 Www.cumt.edu.cn:/home/root/others/music/001.mp3

* Copy directory:
* Command format:
Scp-r Local_folder [Email protected]_ip:remote_folder
Or
Scp-r Local_folder Remote_ip:remote_folder

The 1th one specifies the user name, the command executes after the need to enter the password;
The 2nd does not specify a user name, the command will need to enter the user name and password after execution;
Example
Scp-r/home/space/music/[Email protected]:/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/Catalogue reprint: Http://www.cnblogs.com/xiao-yu/archive/2011/08/05/2128875.html

File transfer between Linux (SCP)

Related Article

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.