通过SCP实现Linux服务器和本地Win10机器的文件上传下载

  服务器上的文件下载还是FileZilla这种FTP工具比较方便,但我本机没装,就用SCP来操作好了。SCP是Security Copy,常用于Linux不同服务器之间的复制。这里我们发挥跨平台的想法,让Windows和Linux之间的复制来实现文件的远程下载。打开本地win10的命令行窗口,开始操作:

  1、下载远程服务器的文件/home/sbt/nginx_nacos.conf到本地E:\BaiduNetdiskDownload目录:

C:\Users\wulf>e:

E:\>cd BaiduNetdiskDownload

E:\BaiduNetdiskDownload>scp sbt@100.100.1.22:/home/sbt/nginx_nacos.conf .
Authorized users only. All activity may be monitored and reported
sbt@100.100.1.22's password:
nginx_nacos.conf                                                                      100% 5437     1.7MB/s   00:00

 

  2、上传本地当前目录下的helloworld.txt文件到远程目录/home/sbt上:

E:\BaiduNetdiskDownload>scp ./helloworld.txt sbt@100.100.1.22:/home/sbt
Authorized users only. All activity may be monitored and reported
sbt@100.100.1.22's password:
helloworld.txt                                                                        100%   12     0.9KB/s   00:00

 

  3、下载一个目录

E:\BaiduNetdiskDownload>scp -r sbt@200.200.6.22:/home/sbt/nacos ./本地
Authorized users only. All activity may be monitored and reported
sbt@200.200.6.22's password:
DEFAULT_GROUP%40%40uisf-initializr-generator                                          100%  266    28.2KB/s   00:00
DEFAULT_GROUP%40%40uisf-admin                                                         100%  236    25.8KB/s   00:00
DEFAULT_GROUP%40%40uisf-auth                                                          100%  234   131.5KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-skill                                                       100%  240    33.8KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-info-source                                                 100%  252   245.9KB/s   00:00
DEFAULT_GROUP%40%40lxy_subtitle                                                       100%  240    40.0KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-skill                                               100%  586   320.6KB/s   00:00
DEFAULT_GROUP%40%40lxy-subtitle                                                       100%  560   113.7KB/s   00:00
DEFAULT_GROUP%40%40uisf-gateway                                                       100%  554   378.3KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-admin-backend                                               100%  256   170.7KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-application                                         100%  610    61.6KB/s   00:00
DEFAULT_GROUP%40%40uisf-monitor                                                       100%  240    24.0KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-application                                                 100%  578   281.8KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-dispatch                                                    100%  246    27.8KB/s   00:00
DEFAULT_GROUP%40%40uisf-initializr-generator                                          100%  266   120.9KB/s   00:00
DEFAULT_GROUP%40%40uisf-admin                                                         100%  236   112.1KB/s   00:00
DEFAULT_GROUP%40%40uisf-auth                                                          100%  542   223.5KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-skill                                                       100%   63    28.7KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-info-source                                                 100%   69    36.6KB/s   00:00
DEFAULT_GROUP%40%40lxy_subtitle                                                       100%   63    20.6KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-skill                                               100%  586    89.4KB/s   00:00
DEFAULT_GROUP%40%40lxy-subtitle                                                       100%  560   230.3KB/s   00:00
DEFAULT_GROUP%40%40uisf-gateway                                                       100%  554   270.2KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-admin-backend                                               100%  586   246.8KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-application                                         100%  610   480.0KB/s   00:00
DEFAULT_GROUP%40%40uisf-monitor                                                       100%  240    36.4KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-application                                                 100%   69    28.4KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-dispatch                                                    100%   66    32.1KB/s   00:00

 

  4、上传一个目录:

E:\BaiduNetdiskDownload>scp -r .\本地\naming sbt@200.200.6.22:/home/sbt
Authorized users only. All activity may be monitored and reported
sbt@200.200.6.22's password:
DEFAULT_GROUP%40%40lxy-subtitle                                                       100%  560    97.2KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-admin-backend                                               100%  256    70.0KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-application                                                 100%  578   320.7KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-application                                         100%  610   365.5KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-skill                                               100%  586   228.6KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-dispatch                                                    100%  246    84.9KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-info-source                                                 100%  252    38.0KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-skill                                                       100%  240    81.1KB/s   00:00
DEFAULT_GROUP%40%40lxy_subtitle                                                       100%  240    89.0KB/s   00:00
DEFAULT_GROUP%40%40uisf-admin                                                         100%  236    74.8KB/s   00:00
DEFAULT_GROUP%40%40uisf-auth                                                          100%  234    61.1KB/s   00:00
DEFAULT_GROUP%40%40uisf-gateway                                                       100%  554   288.1KB/s   00:00
DEFAULT_GROUP%40%40uisf-initializr-generator                                          100%  266   124.1KB/s   00:00
DEFAULT_GROUP%40%40uisf-monitor                                                       100%  240    84.0KB/s   00:00
DEFAULT_GROUP%40%40lxy-subtitle                                                       100%  560   246.5KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-admin-backend                                               100%  586   189.5KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-application                                                 100%   69    31.4KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-application                                         100%  610    99.9KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-backend-skill                                               100%  586   239.3KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-dispatch                                                    100%   66    14.2KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-info-source                                                 100%   69    25.7KB/s   00:00
DEFAULT_GROUP%40%40lxyisa-skill                                                       100%   63    22.3KB/s   00:00
DEFAULT_GROUP%40%40lxy_subtitle                                                       100%   63    26.7KB/s   00:00
DEFAULT_GROUP%40%40uisf-admin                                                         100%  236   141.5KB/s   00:00
DEFAULT_GROUP%40%40uisf-auth                                                          100%  542   133.0KB/s   00:00
DEFAULT_GROUP%40%40uisf-gateway                                                       100%  554   187.5KB/s   00:00
DEFAULT_GROUP%40%40uisf-initializr-generator                                          100%  266    86.9KB/s   00:00
DEFAULT_GROUP%40%40uisf-monitor                                                       100%  240    87.7KB/s   00:00

 

posted on 2020-12-18 11:12  不想下火车的人  阅读(1460)  评论(0编辑  收藏  举报

导航