使用putty上传下载文件(pscp)

putty作为ssh工具开源免费,简单易用。可是如何使用它来上传和下载文件呢?答案在于pscp。

pscp下载地址:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

pscp是一个命令行工具,也就是说,别指望双击它来运行。你需要一个命令行工具,像window的dos,然后把目录切换到pscp.exe所在的目录。

接下来就可以使用命令来上传和下载文件了。使用格式如下:

Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec

上传文件:

pscp [options] source [source...] [user@]host:target
pscp D:\source.txt root@192.168.0.3:/tmp/
//把D盘下的source.txt文件上传到192.168.0.3(我的虚拟机)这个服务器下的/tmp/目录中。

下载文件:

pscp [options] [user@]host:source target
pscp root@192.168.0.3:/tmp/source.txt D:\
//192.168.0.3(我的虚拟机)这个服务器/tmp/目录下的source.txt下载到D盘下。

列出远程服务器:

pscp -ls root@192.168.0.3:/tmp
//列出/tmp目录下的文件。

具体的参数说明,见:http://the.earth.li/~sgtatham/putty/0.63/htmldoc/Chapter5.html#pscp

posted @ 2014-05-06 16:05  luffy_zhong  阅读(3240)  评论(0编辑  收藏  举报