Johnathon22 Johnathon22 - 5 months ago 10
Linux Question

SCP gives File or directory not found

I am having an issue. I am using the SCP command to transfer files from my desktop of my mac osx too my virtual server. The thing is I ran the command and successfully transferred one file from my desktop over to the server, no problem. So i use the same command which is: scp (filename i want to transfer) user@serverip: So basically that looks like --> scp test user@10.0.0.0: (I just used random IP for exmaple. Anyways on the second file im trying to transfer which is also in the document format I continually get No such file or directory. Any ideas on why this might be happening?

Answer

Try the following syntax:

Sending a file from the server you are issuing the command from to another server:

scp /path/to/file.doc user@<IP or hostname>:/path/to/where/it/should/go/

Getting a file from another server to the one you are issuing the command from:

scp user@<IP or hostname>:/path/to/file.doc /path/to/where/it/should/go/

This is the format I reliably use for copying from a location to another location. You can use absolute path, or relative/special character path, such as scp suiterdev@fakeserver:~/folder/file . which would be "Securely copy as suiterdev on host fakeserver the file named 'file' in the location 'home for suiterdev user'/folder/ (the ~ is user home) to the location 'where I am working from on this server' (the dot is the current location).

Hope that helps.

Comments