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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值