Skip to content
Advertisement

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

Anyways on the second file I’m 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?

Advertisement

Answer

To send a file from the local host to another server use:

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

To get a file from another server to the local host use:

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 the file named file in $HOME/folder/ (~ equivalent to ~suiterdev or $HOME) as user suiterdev from host fakeserver to the current directory (.).

However you’ll have to take care that special characters (see the shell’s filename expansion mechanism) used for the remote path are not expanded locally (because that typically is not what you want).

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement