Linux – copy file from one Linux machine to another in a intranet

linuxscp

I used the command:

scp filename.c user@172.100.102.187:/user/pradeep

Here I want to copy file to 172.100.102.187 in /user/pradeep but it gives a
error:

scp: /user/pradeep: No such file or directory

What is the command to copy a file from one system to another?

Best Answer

The command you used is fine.

The problem is that on the machine 172.100.102.187, the directory /user/pradeep does not exist. Are you sure it isn't /home/pradeep or some other name?

Assuming you actually do have that directory on that machine, the problem that might be afflicting you could be 'automounted NFS home directory'. That is, if the home directory is automounted when you login, it could be that scp does not trigger that mount operation, and therefore your home directory appears to be missing. I'm not sure whether this is still a problem - it used to afflict me periodically a decade ago.

Related Question