CentOS: 172.16.100.60 (本地主机IP)
CentOS: 172.16.100.61 (远程主机IP)
实战任务:Linux系统之间文件转输
1、SCP复制本地文件到远程主机
[root@Linux sheel]# scp /home/sheel/file1 [email protected]:/tmp
[email protected]'s password:
file1 100% 94 40.3KB/s 00:00
2、SCP复制本地目录到远程主机
[root@Linux sheel]# scp -r /home/sheel [email protected]:/tmp
[email protected]'s password:
file1 100% 94 53.7KB/s 00:00

file2 100% 94 120.7KB/s 00:00
3、SCP从远程主机复制文件到本地目录
[root@Linux sheel]# scp [email protected]:/tmp/test /home/sheel
[email protected]'s password:
test 100% 46 4.7KB/s 00:00
4、SCP从远程主机复制目录到本地目录
[root@Linux sheel]# scp -r [email protected]:/tmp /home/sheel
[email protected]'s password:
heartalive.lock 100% 0 0.0KB/s 00:00
ixdbafile1 100% 94 2.5KB/s 00:00
ixdbafile1 100% 94 27.3KB/s 00:00
ixdbafile12 100% 94 125.5KB/s 00:00
test 100% 46 69.4KB/s 00:00
实战小结:
“-r”参数是复制目录;
不带“-r”参数是指复制文件;
scp 远程用户名@ip地址:文化的绝对路径 本地Linux系统路径;
本地Linux系统文件路径 远程用户名@ip地址:远程系统文件绝对路径名。