Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Mar 16 '13 at 0:36

This question came from our site for professional and enthusiast programmers.

WinSCP should work; you just need to change the remote directory by selecting .. and then public. – Dan D. Mar 16 '13 at 1:36
You can also load a terminal shell in winscp – pratnala Mar 16 '13 at 5:28

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)?

share|improve this answer
+1 for Sneakernet – Ярослав Рахматуллин Mar 16 '13 at 4:53

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

share|improve this answer

As Dan D. commented, if you use cd ../public in SSH terminal, you can get to the same folder by double-clicking .. folder link (the very top one) in WinSCP and then double-clicking 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 Open Directory command. In the dialog replace the last path component with public and press Enter. E.g. if your initial directory is /home/yourusername, replace the yourusername with public to get /home/public.


share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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!

share|improve this answer
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 Mar 16 '13 at 18:11

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

share|improve this answer

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" \ /cygdrive/c/tmp/files/
share|improve this answer

You must log in to answer this question.