copy file from unix to windows using PUTTY

随声附和 提交于 2019-12-11 11:17:08

问题


I need to copy a file from windows to UNIX to a specific folder and set the file group (chgrp or something). The problem is that i have more than 16 groups in unix.

Is there a way to do it without writing and launching a UNIX script?


回答1:


It should work using PSCP. Instructions:

  1. Download PSCP.EXE from Putty download page
  2. Open command prompt and type set PATH=<path to the pscp.exe file>
  3. In command prompt point to the location of the pscp.exe using cd command
  4. Type pscp
  5. use the following command to copy file form remote server to the local system

    pscp [options] [user@]host:source target

So to copy the file /etc/hosts from the server example.com as user fred to the file c:\temp\example-hosts.txt, you would type:

pscp fred@example.com:/etc/hosts c:\temp\example-hosts.txt

Source




回答2:


The above answer by @Ravi Dhoriya is good but sometimes it does not work. You might need to add the -scp flag to force the scp protocol:

pscp -scp fred@example.com:/etc/hosts c:\temp\example-hosts.txt


来源:https://stackoverflow.com/questions/23308092/copy-file-from-unix-to-windows-using-putty

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!