user1616144
user1616144

Reputation: 43

copy file from Windows to UNIX using PUTTY

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?

Upvotes: 1

Views: 43884

Answers (2)

VCarstein
VCarstein

Reputation: 1

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 [email protected]:/etc/hosts c:\temp\example-hosts.txt

Upvotes: 0

Ravi Dhoriya ツ
Ravi Dhoriya ツ

Reputation: 4414

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 [email protected]:/etc/hosts c:\temp\example-hosts.txt

Source

Upvotes: 4

Related Questions