Dan Rubio
Dan Rubio

Reputation: 4907

Is this the correct syntax to scp a downloaded file into Ubuntu?

I downloaded the latest version of swig that I need to move to Ubuntu. I was hoping someone could help identify what part of my syntax is incorrect. I've tried a number of variations but I can't quite seem to get it write.

I've tried

scp swig-3.0.2 [email protected]: swig-3.0.2
swig-3.0.2 is a directory (not copied)

scp swig-3.0.2 [email protected]: /home/drubio/swig-3.0.2
No such file or directory

I've tried implementing directions that I've found on askubuntu.com reproduced here:

# copy a file from local machine to server1.com
  user@local-machine# scp ./somefile.txt [email protected]:/home/user2

# copy a file from server1.com to server2.com
  user@local-machine# ssh [email protected]
  user1@server1# scp ./somefile.txt [email protected]:/home/user2
  user@server1# logout

# copy a file from server2.com to server1.com
  user@local-machine# ssh [email protected]
  user2@server2# ls
  somefile.txt    otherfile.txt
  user2@server2# scp ./otherfile.txt [email protected]:/home/user1
  user2@server2# logout

# can't copy a file TO local-machine because it's not accessible from internet

All I'm trying to do is to copy the downloaded swig-3.03 located on my local machine's Desktop on to Ubuntu. I've checked on my local machine where I'm at and I've verified that I am in the Desktop directory. My username is correct and the path is right. I'm assuming that the mistake is the destination point. Am I wrong to assume this?

Upvotes: 0

Views: 262

Answers (1)

jmlemetayer
jmlemetayer

Reputation: 4952

The correct syntax is:

scp swig-3.0.2 [email protected]:swig-3.0.2    
scp swig-3.0.2 [email protected]:/home/drubio/swig-3.0.2

Without the spaces!

The usage is for copy local to remote:

scp /path/to/my_local_file user@host:/path/to/my_copy_file

or for copy remote to local:

scp user@host:/path/to/my_remote_file /path/to/my_copy_file

Upvotes: 2

Related Questions