Linux remote copy scp command usage example

1. Copy the entire directory /home/administrator/test of the local machine to the /root directory of the remote host 192.168.1.100:
scp -r /home/administrator/test/ [email protected]:/root/

2. Copy a single file to a remote host:
scp /home/administrator/Desktop/old/driver/test/test.txt [email protected]:/root/

In fact, the difference between uploading files and folders lies in the parameter -r, which is similar to the parameters of cp and rm, and the text increases with multiple -r
3. Remote file/folder download For
example , put the /root/ folder on 192.168.62.10, Download it to the local /home/administrator/Desktop/new/ and log in using the root of the remote end
scp -r [email protected]:/root/ /home/administrator/Desktop/new/

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327106720&siteId=291194637