[root@localhost soft]# ll
总计 80556
drwxr-xr-x 12 root root 4096 09-21 18:40 fms3.5
drwxr-xr-x 3 root root 4096 09-21 17:58 fms4.5
drwxr-xr-x 10 root root 4096 10-30 17:15 jdk1.6.0_16
drwxr-xr-x 10 root root 4096 09-17 19:27 jdk1.6.0_16.bak
-rwxr-xr-x 1 root root 81871260 2009-12-21 jdk-6u16-linux-x64.bin
drwxrwxrwx 2 root root 4096 09-21 01:16 mysql
-rw-r--r-- 1 root root 490220 03-15 09:11 nginx-0.5.38.tar.gz
drwxr-xr-x 3 root root 4096 09-21 18:40 setup_file
drwxr-xr-x 9 root root 4096 09-17 19:23 tomcat6.0.32
drwxr-xr-x 9 root root 4096 2012-08-14 tomcat_7.0
[root@localhost soft]# scp -r root@192.168.120.204:/opt/soft/mongodb /opt/soft/
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:01
mongostat 100% 7808KB 7.6MB/s 00:00
mongos 100% 5262KB 5.1MB/s 00:01
mongo 100% 3707KB 3.6MB/s 00:00
mongoimport 100% 7754KB 7.6MB/s 00:00
mongodump 100% 7773KB 7.6MB/s 00:00
GNU-AGPL-3.0 100% 34KB 33.7KB/s 00:00
[root@localhost soft]# ll
总计 80560
drwxr-xr-x 12 root root 4096 09-21 18:40 fms3.5
drwxr-xr-x 3 root root 4096 09-21 17:58 fms4.5
drwxr-xr-x 10 root root 4096 10-30 17:15 jdk1.6.0_16
drwxr-xr-x 10 root root 4096 09-17 19:27 jdk1.6.0_16.bak
-rwxr-xr-x 1 root root 81871260 2009-12-21 jdk-6u16-linux-x64.bin
drwxr-xr-x 3 root root 4096 03-15 09:18 mongodb
drwxrwxrwx 2 root root 4096 09-21 01:16 mysql
-rw-r--r-- 1 root root 490220 03-15 09:11 nginx-0.5.38.tar.gz
drwxr-xr-x 3 root root 4096 09-21 18:40 setup_file
drwxr-xr-x 9 root root 4096 09-17 19:23 tomcat6.0.32
drwxr-xr-x 9 root root 4096 2012-08-14 tomcat_7.0
[root@localhost soft]#
说明:
从192.168.120.204机器上的/opt/soft/中下载mongodb 目录到本地的/opt/soft/目录来。
实例3:上传本地文件到远程机器指定目录
命令:
scp /opt/soft/nginx-0.5.38.tar.gz root@192.168.120.204:/opt/soft/scptest
输出:
上传前目标机器的目标目录:
[root@localhost soft]# cd scptest/
[root@localhost scptest]# ll
总计 0
[root@localhost scptest]# ll