Linux system management and maintenance - scp command

  
 

Function description: scp is a secure copy, copying files or directories from one Linux system to another. The scp transmits data using the ssh protocol, which ensures the security of data transmission. Use format: scp remote user name @ip address: absolute path of file local linux system path scp local linux system file path remote user name @ip address: remote system file absolute path name supplementary description: scp use format one is remote linux system Copy a file or directory to a local Linux system. Use format 2 to copy a local file or directory to a remote Linux system. Example: 1. Currently we are in the ip system of 192.168.60.133”, plan to copy the /home/ixdba/etc.tar.gz file under this system to the remote linux system with ip "192.168.60.168" In the /tmp directory under the root user, use the following command: [root@oracledb~]#scp /home/ixdba/etc.tar.gz [email protected]:/tmp# After the command is entered, you will be asked to enter "ldquo; 192.168.60.168” The password of the server root, and then start remote copying data. If we are currently on the server 192.168.60.168, we can also use the following command to transfer data: [root@oracledb~]#scp [email protected]:/home/ixdba/etc.tar.gz /tmp# After the command is entered, you will be asked to enter the password of the server root and then start remote copying the data. 2. Copy all the files and subdirectories in the local /etc directory to the /opt directory under the root user of the remote linux system with ip "192.168.60.135"; use the following command: [root@oracledb~]#scp –r /etc [email protected]:/opt# The options here are the same as the "r” option in the cp command.

Copyright © Windows knowledge All Rights Reserved