一直以来,都使用winscp这个小工具,从服务器上上传和下载文件,拖拖拉拉就完成了文件的上传和下载,很方便。winscp基于putty开发。今天,使用putty套件下的psftppscp,感受一下命令行下的上传操作(下载操作类似)。


C:\zhou\putty>psftp oracle@192.168.1.110

Using username "oracle".

oracle@192.168.1.110's password:

Remote working directory is /home/oracle

psftp> put C:\xxxx\p13390677_112040_Linux-x86-64_3of7.zip

local:C:\xxxx\p13390677_112040_Linux-x86-64_3of7.zip => remote:/home/oracle/p133

90677_112040_Linux-x86-64_3of7.zip

psftp> put -r C:\xxxx

local:C:\xxxx\p13390677_112040_Linux-x86-64_3of7.zip => remote:/home/oracle/xxxx

/p13390677_112040_Linux-x86-64_3of7.zip


C:\zhou\putty>pscp C:\xxxx oracle@192.168.1.110

Local to local copy not supported


C:\zhou\putty>pscp -r C:\xxxx oracle@192.168.1.110:/home/oracle

oracle@192.168.1.110's password:

p13390677_112040_Linux-x8 | 1177003 kB | 8916.7 kB/s | ETA: 00:00:00 | 100%


C:\zhou\putty>pscp C:\xxxx\p13390677_112040_Linux-x86-64_3of7.zip oracle@192.

168.1.110:/home/oracle

oracle@192.168.1.110's password:

p13390677_112040_Linux-x8 | 283748 kB | 9784.4 kB/s | ETA: 00:01:31 |  24%



psftppscp都支持单文件和目录的上传操作,操作成功后,服务器上会出现同名的文件和目录(psftppscp支持上传目录和文件名更改)。psftp默认会上传到用户的主目录,pscp需要显示的指明上传的路径。上传文件的时候,psftp不显示进度,pscp有详细地进度显示。