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]#

  • 相关阅读:
    使用idea的过程中,遇到其中一个maven模块变成灰色
    Java进阶之类加载的完整过程(类的生命周期)(转载)
    mysql 一些小问题
    @select 添加判断
    om.alibaba.com.caucho.hessian.io.HessianProtocolException: com.alibaba.com.caucho.hessian.io.ObjectDeserializer: unexpected object java.lang.String (CU) 调用dubbo返回这个错误
    方法重载
    形参和实参
    方法
    数组操作两个常见的小问题
    数组初始化
  • 原文地址:https://www.cnblogs.com/heyang78/p/3524157.html
Copyright © 2011-2022 走看看