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 [email protected]:
(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?
To copy a directory (and all the files it contains), use scp with the -r option. This tells scp to recursively copy the source directory and its contents.
Copy Files and Directories Between Two Systems with scp The /remote/directory is the path to the directory you want to copy the file to. If you don't specify a remote directory, the file will be copied to the remote user home directory.
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).
Well for me am using Ubuntu 15.10 and this is what worked for me.
scp [email protected]:path/to/file.txt /home/to/local/folder/
instead of
scp [email protected]:/path/to/file.txt /home/to/local/folder/
Note that after [email protected] host i do not include the forward slash i immediately append the folder after the ":"
Scp uses the target user's home directory as default directory (as a relative path), so when you need an absolute path, then use one (starting with a slash (/
)).
I know this is way too late for this to help you, but it may help others who had the same problem as me
for my case my pc is set up to use backwards slash "\"
instead of forward slash "/"
and changing to backwards slashes removed the errors
But I only had to change the slashes to backward slashes on my pc's directory as my raspberry pi uses forward slashes.
I know it is a bit confusing but it worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With