Linux机器件拷贝文件

来源:互联网 发布:淘宝虚拟市场怎么加入 编辑:程序博客网 时间:2024/06/05 03:34

常用命令有:sftp,scp


sftp


[root@zengmg develop_soft]# sftp 192.168.255.132
Connecting to 192.168.255.132...
The authenticity of host '192.168.255.132 (192.168.255.132)' can't be established.
RSA key fingerprint is bd:09:eb:22:2f:ed:95:57:ab:89:f0:98:2d:40:35:c9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.255.132' (RSA) to the list of known hosts.


root@192.168.255.132's password: 
sftp> put /develop_soft/*.gz /develop_soft/
Uploading /develop_soft/hadoop-2.7.2.tar.gz to /develop_soft/hadoop-2.7.2.tar.gz
/develop_soft/hadoop-2.7.2.tar.gz                                                                    100%  202MB  50.6MB/s   00:04    
Uploading /develop_soft/jdk-8u73-linux-x64.tar.gz to /develop_soft/jdk-8u73-linux-x64.tar.gz
/develop_soft/jdk-8u73-linux-x64.tar.gz                                                              100%  173MB  28.8MB/s   00:06    

sftp> exit


SCP


scp -rp user1@host1:/filepath1 user2@host2:/filepath2
-p      Preserves modification times, access times, and modes from the original file.
备份模式(修改时间、访问时间及modes)
-r      Recursively copy entire directories.
递归地复制整个目录

实例:

[root@zengmg develop_soft]# scp *.gz root@192.168.255.133:/develop_soft
The authenticity of host '192.168.255.133 (192.168.255.133)' can't be established.
RSA key fingerprint is bd:09:eb:22:2f:ed:95:57:ab:89:f0:98:2d:40:35:c9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.255.133' (RSA) to the list of known hosts.

root@192.168.255.133's password: 
hadoop-2.7.2.tar.gz                                                                                  100%  202MB  67.4MB/s   00:03    
jdk-8u73-linux-x64.tar.gz                                                                            100%  173MB  34.6MB/s   00:05    





-p      Preserves modification times, access times, and modes from the original file.
备份模式(修改时间、访问时间及modes)


-r      Recursively copy entire directories.
递归地复制整个目录



0 0
原创粉丝点击