Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Jan 14 '11 at 0:30

This question came from our site for professional and enthusiast programmers.

1  
You are using the correct command. Can you confirm that the target location is infact /user/pradeep and not something like /usr/pradeep etc? Also, can you confirm that the user directory does in fact sit at the server root and not your home directory root? –  ndtreviv Jan 12 '11 at 13:44

3 Answers 3

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.

share|improve this answer
    
You can simply use scp.....:~ as the home directory also. –  Anders Jan 12 '11 at 13:48

Well your syntax seems good :

scp /path/to/local/file user@remote_host:/path/to/file/on/remote/host

Your error is that there is no directory /user/pradeep on 172.100.102.187 or that user has no right to see it ^^

Try ssh user@172.100.102.187 and cd /user/pradeep you should get the same error.

my2c

share|improve this answer

For file-- scp filename(with path) root@ip address or hostname:/root/path of the file

For directory--scp -r directory name(with path) root@ip address or hostname:/root/Directory path

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.