cp: cannot stat : No such file or directory
10,413
You have TWO problems.
A: you're apparently are on the machine you're trying to copy to, rather than the one you're trying to copy from
B: cp cannot transfer between machines.
To resolve A try
scp [email protected]:/home/username/some.xml /path/to/directory/
Related videos on Youtube
Author by
CodeMed
Updated on September 18, 2022Comments
-
CodeMed almost 2 years
I am getting an error when I try to copy a file from my local computer to a remote server. I get the same error whether I use
cp
orscp
.Here is my input at the resulting error:
[[email protected] /]# cp /home/username/some.xml [email protected]:/path/to/directory/ cp: cannot stat ‘/home/username/some.xml’: No such file or directory
I have checked, and there is definitely a file at the path
/home/username/some.xml
on my local machine.Both the local computer and the remote server are running CentOS 7. How can I resolve this error and copy successfully?
-
CodeMed over 9 yearsMy
cp
command in my OP above was correct with two minor modifications. 1.) I had to typeexit
to log out as[email protected]
and thus get a prompt on my local machine, and 2.) I had to changecp
toscp
in order to send the data to the remote web server. Since your answer pointed me in the right direction, I am accepting, it, but the solution was what I am typing in this comment. +1 for helping.