您的位置:首页 > 运维架构 > Linux

用PSCP在Windows和Linux之间相互传输文件

2014-01-17 15:53 483 查看
在Linux服务器之间相互传文件我们常用 scp命令,但是在Linux和Windows之间相互传输就不那么直接了。

使用 Putty的 PSCP 则会简单的多

1. 下载

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

2. 设置Windows机器的环境变量

下载的pscp是个简单的exe文件,设置下Path环境变量即可

使用说明如下,和SCP命令很像

E:\ClientDump\PROD_DB_20131119\DBBackUp2013115>pscp
PuTTY Secure Copy client
Development snapshot 2014-01-17:r10117
Usage: pscp [options] [user@]host:source target
pscp [options] source [source...] [user@]host:target
pscp [options] -ls [user@]host:filespec
Options:
-V        print version information and exit
-pgpfp    print PGP key fingerprints and exit
-p        preserve file attributes
-q        quiet, don't show statistics
-r        copy directories recursively
-v        show verbose messages
-load sessname  Load settings from saved session
-P port   connect to specified port
-l user   connect with specified username
-pw passw login with specified password
-1 -2     force use of particular SSH protocol version
-4 -6     force use of IPv4 or IPv6
-C        enable compression
-i key    private key file for authentication
-noagent  disable use of Pageant
-agent    enable use of Pageant
-batch    disable all interactive prompts
-unsafe   allow server-side wildcards (DANGEROUS)
-sftp     force use of SFTP protocol
-scp      force use of SCP protocol


3. 上传到Linux

E:\ClientDump\PROD_DB_20131119\DBBackUp2013115>pscp RSKORGP1_RA_ARCH.dmp libi@AP
C-LGROPFDB601:/u00/software/CIT/RSKORGP1_RA_ARCH.dmp
libi@APC-LGROPFDB601's password:
RSKORGP1_RA_ARCH.dmp      | 6475872 kB | 11564.1 kB/s | ETA: 00:00:00 | 100%


4. 从Linux下载

E:\ClientDump\PROD_DB_20131119\DBBackUp2013115>pscp libi@APC-LGROPFDB601:/home/l
ibi/.bash_profile bash_profile
libi@APC-LGROPFDB601's password:
bash_profile              | 0 kB |   0.2 kB/s | ETA: 00:00:00 | 100%


5. 操作整个目录

添加 -r 参数即可传输整个目录,很方便

-r        copy directories recursively
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: