scp command - file upload and download operations between remote server and local


foreword

The scp command is more convenient in linux. Below is an example.


1. Upload files from the local desktop to the remote server

scp -P 11025  /Users/zangcc/Desktop/hello.zip root@服务器ip:/root/tools

-p --> The port of ssh, if not written, the default is 22.
/Users/zangcc/Desktop/hello.zip --> local desktop file hello.zip.
root@server ip:/root/tools --> Upload to /root/tools of the remote server.

In layman's terms: upload the hello.zip of the local desktop to the /root/tools directory of the server.

2. Download the file from the remote server to the local desktop

scp -P 11025 root@服务器ip:/root/code/test/build/mycppdatabase.zip /Users/zangcc/Desktop

-p --> The port of ssh, if not written, the default is 22.
root@server ip:/root/code/test/build/mycppdatabase.zip --> the address of the remote server and mycppdatabase.zip.
/Users/zangcc/Desktop --> Download to the local desktop.

In layman's terms: download the server's /root/code/test/build/mycppdatabase.zip to the local desktop.


Summarize

Both commands are run on the terminal of the machine , not the terminal of the server! ! ! ! It's native! !
Both commands are run on the terminal of the machine , not the terminal of the server! ! ! ! It's native! !
Both commands are run on the terminal of the machine , not the terminal of the server! ! ! ! It's native! !

    The article is original, welcome to reprint, please indicate the source of the article: scp command-file upload and download operations between the remote server and the local .. Baidu and various collection sites are not trustworthy, please be careful when searching. Technical articles are generally time-sensitive. I am used to revising and updating my blog posts from time to time, so please visit the source to view the latest version of this article.

Guess you like

Origin blog.csdn.net/weixin_43847838/article/details/130729877