I am running a putty client on a Windows machine to connect successfully to a Linux box. Now I want to be able to copy a file from the Linux machine under the path /home/ubuntu/myfile
to C:/Users/Anshul/Desktop
on my local computer. The user at the Windows machine is anshul
. I am giving the following command on putty but it is not working:
scp /home/ubuntu/myfile ip_address_of_windows_machine:C:/Users/Anshul/Desktop
I think the path for the Windows machine is wrong. Please help as I have banged my head on a large number of forums but none seem to give correct path for Windows server. Don't suggest alternate options like WinScp
Open bash window. Preferably git bash. write
scp username@remote_ip:/directory_of_file/filename 'windows_location_you_want_to_store_the_file'
Example:
Suppose your username is jewel
your IP is 176.35.96.32
your remote file location is /usr/local/forme
your filename is logs.zip
and you want to store in your windows PC's D drive forme folder then the command will be
scp jewel@176.35.96.32:/usr/local/forme/logs.zip 'D:/forme'
**Keep the local file directory inside single quote.
As @Hesham Eraqi suggested, it worked for me in this way (transfering from Ubuntu to Windows (I tried to add a comment in that answer but because of reputation, I couldn't)):
where:
-v
: show verbose messages.-r
: copy directories recursively.-P
: connect to specified port.53670
: the port number to connect the Ubuntu server.\\Desktop-mojbd3n\d\genetic_map_data\
: I needed to transfer to an external HDD, thus I had to give permissions of sharing to this device.Your code isn't working because c:/ or d:/ is totally wrong for linux just use /mnt/c or/mnt/c
From your local windows10-ubuntu bash use this command:
for download: (from your remote server folder to d:/ubuntu) :
Then type your remote server password if there is need.
for upload: (from d:/ubuntu to remote server ) :
Then type your remote server password if there is need. note: I tested and it worked.
Download
pscp
from Putty download page, then use it from Windows machine CMD like this:It will ask you about the username password of Linux machine, then do the copy for you.
If you want to copy paste files from Unix to Windows and Windows to Unix just use filezilla with port 22.
Try this, it really works.
And for copying all files