Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used the command:

scp filename.c user@

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

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 Jan 14 '11 at 0:30

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

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

The command you used is fine.

The problem is that on the machine, 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 or that user has no right to see it ^^

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


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

You must log in to answer this question.