Monday, 12 August 2019

linux - How can I copy files with SSH?


I am trying to copy a file from my other computer, to another computer. (both running Ubuntu 9.10)


So, I've ssh'ed into the other computer; I cd to the directory; and I entered cp File.zip /home/me/Desktop as file.zip is located in the directory I just used cd with.


Now, it gives me the following error message:


cannot create regular file '/home/me/Desktop': no such file or directory


What do I have to do?



Answer



This isn't really programming related, but you can use scp to do this.


scp file.zip remote-box-name:/path/to/destination/file.zip

If your username is different on the remote box, you will need to prefix it:


scp file.zip yourusername@remotebox:/path/to/destination/file.zip

And to retrieve a file you could do this:


scp remotebox:/path/to/destination/file.zip file.zip

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...