How can I move files from Windows to Linux using WinSCP?

1

2

I have PuTTY and WinSCP, but WinSCP doesn't work in this case because I need to use a command cd ../public in order to enter the directory as I can't find it for some reason.

How would I use PuTTY or the command prompt to copy Windows files onto a Linux server? Would cat work in copying and pasting the file over?

Jamie Nash

Posted 2013-03-16T00:15:06.680

Reputation:

2WinSCP should work; you just need to change the remote directory by selecting .. and then public. – Dan D. – 2013-03-16T01:36:18.550

You can also load a terminal shell in winscp – pratnala – 2013-03-16T05:28:21.163

Answers

1

Do you have physical access to both computers?  Can you “sneakernet” the files (i.e., copy them to some portable storage device, such as a flash drive, and carry it to the other machine)?

Scott

Posted 2013-03-16T00:15:06.680

Reputation: 17 653

1

If you can read the files in PuTTY, you can copy them with WinSCP:

  1. navigate to the folder where your files are using cd
  2. run pwd -P
  3. start WinSCP
  4. navigate to the folder as indicated in step 2.
  5. mark desired files, copy them to the local target folder
  6. enjoy a coffee break

If you insist on CLI, then rsync is a far superior option to scp. First you need to figure out where your files are (see step 1. and 2. above). When you have that, copying files is a simple matter of:

"C:\Program Files (x86)\cwRsync\bin\rsync.exe" \
    username@remoteServer.com:/path/with/files/ /cygdrive/c/tmp/files/

Ярослав Рахматуллин

Posted 2013-03-16T00:15:06.680

Reputation: 9 076

http://www.rsync.net/resources/howto/windows_rsync.html – Ярослав Рахматуллин – 2013-03-16T05:10:32.263

1

I think I would use Rsync from PuTTY on Windows.

The benefit of using Rsync is knowing that Windows is likely to need to be restarted part-way through the file copying if there is a significant number of files, at least if using Rsync, you won't have to start the copy process all over again.

Rsync can work over NFS, SSH, and even Samba (and others), so no reason why this won't work.

This is a sample of how the command might look:

rsync -avzthH --stats --progress --delete-after --partial-dir=.rsync-partial /source\ directory/ /my\ old \windows\ files/ -e ssh user@linuxpc:/my\ old\ windows\ files\

Welcome to Linux!

Peter Snow

Posted 2013-03-16T00:15:06.680

Reputation: 213

Welcome to SuperUser, Peter. Can you expand your answer to explain what those commands do? We get lots of Google traffic here as well – Canadian Luke – 2013-03-16T18:11:47.520

0

I am not sure what you mean by WinSCP not working. Are you referencing to the command line function of WinSCP or something similar that I don't know?

But in any case, if you have PuTTY, you should have pscp in the same directory, which stands for putty-scp. Make sure the pscp executable is somewhere in the search path of Windows, and then do:

c:\> cd \file\source\directory\here
c:\> pscp file_name user@linuxserver:/destination/directory/name/here

Here you are going to be asked the password for the user you specified on the pscp line.

There are different switches for pscp, but without knowing what you are exactly doing, it is hard to tell which ones to use what way.

MelBurslan

Posted 2013-03-16T00:15:06.680

Reputation: 835

0

One option could be to share your directory from the Linux machine as a Samba share for the Windows machine to map to. Then you can use Windows Explorer to navigate and work with your files.

Another options could be to mount a Windows share into the Unix filesystem to move files around using standard Unix file operation commands.

cmevoli

Posted 2013-03-16T00:15:06.680

Reputation: 276

0

Use enduradata's file transfer: http://www.enduradata.com (the demo license has all the functionality you need). It will handle open files as well.

elhaddi

Posted 2013-03-16T00:15:06.680

Reputation: 1

0

As Dan D. commented, if you use cd ../public in an SSH terminal, you can get to the same folder by double-clicking .. folder link (the very top one) in WinSCP and then double-clicking the public.

Chances are that you do not have a read access to the parent (..) folder, so you cannot do the first step.

In that case use the Open Directory command. In the dialog, replace the last path component with the public and press Enter. E.g. if your initial directory is /home/yourusername, replace the yourusername with the public to get /home/public.

Martin Prikryl

Posted 2013-03-16T00:15:06.680

Reputation: 13 764

0

You can use a third-party application, like the FileZilla client.

Scorpion99

Posted 2013-03-16T00:15:06.680

Reputation: 1 023