zoukankan      html  css  js  c++  java
  • SCP远程拷贝命令

    利用scp指令可以在linux机器间传递文件,个人使用几次感觉效率还是较高的,比SFTP+本地做媒介要高得多。

    1.本地拷贝到远程

    这种方式的命令模式是scp local_file remote_username@remote_ip:remote_file

    示例如下:

    [root@msg45 hy]# ls
    rpm  test.txt  wasliberty

    将test.txt从本地拷贝到远程
    [root@msg45 hy]# scp test.txt root@msg43.matson.ufo.com:/home/hy/
    The authenticity of host 'msg43.matson.ufo.com (91.200.193.93)' can't be established.
    RSA key fingerprint is dc:ab:dc:c8:09:6d:c7:fe:b5:f6:b8:9a:93:89:75:07.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'msg43.matson.ufo.com,91.200.193.93' (RSA) to the list of known hosts.
    root@msg43.matson.ufo.com's password:
    test.txt                                                                                                                                       100%   15     0.0KB/s   00:00    
    [root@msg45 hy]#

    2.远程拷贝到本地

    从 远程 复制到 本地,只要将 从 本地 复制到 远程 的命令 的 后2个参数 调换顺序 即可,如下。

    scp  remote_username@remote_ip:remote_file local_file

    示例如下:

    [root@msg45 hy]# scp root@msg43.matson.ufo.com:/home/hy/test.txt  test1.txt
    root@msg43.matson.ufo.com's password:
    test.txt                                                                                                                                       100%   15     0.0KB/s   00:00    
    [root@msg45 hy]#

  • 相关阅读:
    xshell入门及Linux常用命令
    C++之vector
    c++ 之 string
    引用 与 指针
    关于时间复杂度的计算以及相关概念
    位运算
    thymeleafDemo
    面试总结
    关于mvvm原理实现,模拟vue(3)-----发布订阅
    关于mvvm原理实现,模拟vue(2)-----模板编译
  • 原文地址:https://www.cnblogs.com/heyang78/p/3524157.html
Copyright © 2011-2022 走看看