Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Mar 16 '13 at 0:36

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

2  
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

8 Answers 8

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 pscp executable is somewhere in the search path of windows then

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 know 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 the 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

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

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/
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

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.

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.

See http://winscp.net/eng/docs/task_navigate#manual

share|improve this answer

You can use a 3rd party like Filezilla client.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.