Cp/scp command + scp command in linux

Source: Internet
Author: User
Tags ftp client scp command scp command in linux

Linux cp/scp command + scp command \ svn Delete All. Svn file find. -name. svn-type d-exec rm-fr {}\; Name: cp usage permission: All Users usage: cp [options] source destcp [options] source... directory Description: copy one file to another, or copy several files to another directory. Copy as much information as possible, such as the file status and permissions. -R if the source contains the directory name, the files under the directory are also copied to the destination in sequence. -F if the destination already has an archive with the same file name, delete it before copying. Example: copy the file aaa (already exists) and name it bbb: cp aaa bbb. Copy all C language programs to the Finished subdirectory: cp *. c Finished command: There are three common methods to copy files between Linux with scp: ftp, that is, installing ftp Server on one of Linux, in this way, another ftp client program can be used to copy files. The second method is to use the samba service, similar to the Windows file copy method, which is simple and convenient. The third is to use the scp command to copy files. Scp is a file copy with Security and is used for ssh logon. For example, to copy the current file to another remote host, you can run the following command. Scp/home/daisy/full.tar.gz root@172.19.2.75:/home/root then you will be prompted to enter another 172.19.2.75 host root user login password, and then start copy. If you want to copy files from the remote host to the current system, it is also very easy. Scp root @/full.tar.gz 172.19.2.75:/home/root/full.tar.gz home/daisy/full.tar.gz scp command in 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: remote_folder or scp local_file remote_username @ remote_ip: remote_file or scp local_f Ile remote_ip: remote_folder or scp local_file remote_ip, 2nd specify the file name; 3 or 4 do not specify the user name. After the command is executed, enter the user name and password. 3rd specify only the remote directory, and the file name remains unchanged, 4th specify the file name; * example: 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/o Thers/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 remote_username @ remote_ip: remote_folder or scp-r local_folder remote_ip: remote_folder 1st specifies the user name. After the command is executed, enter the password. 2nd users do not specify the user name. After the command is executed, enter the user name and password; * example: 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/above Copy the local music directory to the remote others directory .. /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/1.mp3 scp-r www.cumt.edu.cn: /home/root/others/home/space/music/the simplest application is as follows: scp Local User Name @ IP Address: file name 1 remote user name @ IP Address: file name 2 [local user name @ IP Address:] can be left blank. You may need to enter the password corresponding to the remote user name. possible useful parameters:-v and most The-v in the linux Command indicates the same progress. it can be used to view connections, authentication, or configuration errors. -C enable compression options. -P: select the port. note:-p has been used by rcp. -4 Use the IPV4 address forcibly. -6 Use IPV6 addresses forcibly. note: 1. if the remote server firewall has special restrictions, scp will go through the special port, the specific port depends on the situation, the command format is as follows: # scp-p 4588 remote@www.abc.com: /usr/local/sin. sh/home/administrator2. when using scp, pay attention to whether the user in use has the permission to read the corresponding files on the remote server.

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.