本地机器上传:
[root@localhost soft]# scp /opt/soft/nginx-0.5.38.tar.gz root@192.168.120.204:/opt/soft/scptest
root@192.168.120.204's password:
nginx-0.5.38.tar.gz 100% 479KB 478.7KB/s 00:00
[root@localhost soft]#
上传后目标机器的目标目录:
[root@localhost scptest]# ll
总计 484
-rw-r--r-- 1 root root 490220 03-15 09:25 nginx-0.5.38.tar.gz
[root@localhost scptest]#
说明:
复制本地opt/soft/目录下的文件nginx-0.5.38.tar.gz 到远程机器192.168.120.204的opt/soft/scptest目录
实例4:上传本地目录到远程机器指定目录
命令:
scp -r /opt/soft/mongodb root@192.168.120.204:/opt/soft/scptest
输出:
上传前目标机器的目标目录:
[root@localhost ~]# cd /opt/soft/scptest/
[root@localhost scptest]# ll
总计 484
-rw-r--r-- 1 root root 490220 03-15 09:25 nginx-0.5.38.tar.gz
[root@localhost scptest]#
本地机器上传:
[root@localhost ~]# scp -r /opt/soft/mongodb root@192.168.120.204:/opt/soft/scptest
root@192.168.120.204's password:
mongodb-linux-i686-static-1.8.5.tgz 100% 28MB 28.3MB/s 00:01
README 100% 731 0.7KB/s 00:00
THIRD-PARTY-NOTICES 100% 7866 7.7KB/s 00:00
mongorestore 100% 7753KB 7.6MB/s 00:00
mongod 100% 7760KB 7.6MB/s 00:01
mongoexport 100% 7744KB 7.6MB/s 00:00
bsondump 100% 7737KB 7.6MB/s 00:00
mongofiles 100% 7748KB 7.6MB/s 00:00
mongostat 100% 7808KB 7.6MB/s 00:01
mongos 100% 5262KB 5.1MB/s 00:00
mongo 100% 3707KB 3.6MB/s 00:00
mongoimport 100% 7754KB 7.6MB/s 00:01
mongodump 100% 7773KB 7.6MB/s 00:00
GNU-AGPL-3.0 100% 34KB 33.7KB/s 00:00
[root@localhost ~]#