Linux scp remote Copy command usage

Source: Internet
Author: User
Tags scp command ssh port

For details about how to use the Linux scp remote Copy command, there are three common methods for data exchange or data migration between the local network and the remote network: ftp, second, wget/fetch. Third, rsync uses rysync for large-scale data migration, followed by fetch/wget. The longest is ftp, and the slowest is ftp. in the past few days, ssh scp is used for data migration during busy data migration. The speed and effect are good. In particular, many servers change the default ssh port 22 to a special port for security purposes. So. When using scp or sftp, you must specify the port through which to migrate data. Now, write down the scp command for this special port. Scp-p port user @ serverip:/home/user/filename the above port p is the parameter, the port user is the ssh user serverip is the remote server ip or domain name, /home/user/filename is the name of the remote server/home/user/filename is the name of the Local Service server. This command is used to copy the remote filename to the local directory. Scp has a huge role. For detailed usage, you can use man scp or scp-help. The following is a detailed description of scp... The scp command of linux can copy files and directories between linux; ========================= scp command =================================== scp can copy files between two linux Hosts; command basic format: scp [optional parameter] file_source file_target ====== copy from local to remote =====* copy file: * command format: scp local_file remote_username @ remote_ip: unique or scp local_file remote_username @ remote_ip: remote_file or scp local_file remote_ip: unique or scp local_file remote_ip: remote_file the user name is specified at 1 and 2, after the command is executed, you need to enter the password again. Only the remote directory is specified for the 1st files. The file name remains the same, and the file name is specified for the 2nd files. No user name is specified for the 3 or 4 files, after the command is executed, enter the user name and password. Only the remote directory is specified for the 3rd files. The file name remains the same, and the file name is specified for the 4th commands. * routine: scp/home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/musicscp/home/space/music/1.mp3 root@www.cumt.edu.cn: /home/root/others/music/002.mp3 scp/home/space/music/1.mp3 www.cumt.edu.cn:/home/root/others/musicscp/home/space/music/1.mp3 www.cumt.edu.cn: /home/root/others/music/002.mp3 * Copy Directory: * Command Format: scp-r local_folder remote_username @ remote_ip: remote_folder or scp-r local_folder remote_ip: remote_folder 1st specifies the user name, And the password needs to be entered after the command is executed; 2nd does not specify the user name, and the user name and password need to be entered after the command is executed; * routine: 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, that is, there is a remote copy .. /others/music/directory ====== copy from remote to local ==== copy from remote to local, just Replace the last two parameters that copy from local to remote command; for example: scp root@www.cumt.edu.cn: /home/root/others/music/home/space/music/iw.scp-r www.cumt.edu.cn:/home/root/others/home/space/music/

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.