Is this the correct syntax to scp a downloaded fil

2019-08-16 13:51发布

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 user_name@111.111.11.111: swig-3.0.2
swig-3.0.2 is a directory (not copied)

scp swig-3.0.2 drubio@192.168.56.101: /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 user1@server1.com:/home/user2

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

# copy a file from server2.com to server1.com
  user@local-machine# ssh user2@server2.com
  user2@server2# ls
  somefile.txt    otherfile.txt
  user2@server2# scp ./otherfile.txt user1@server1.com:/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?

标签: linux ubuntu
1条回答
ゆ 、 Hurt°
2楼-- · 2019-08-16 14:38

The correct syntax is:

scp swig-3.0.2 user_name@111.111.11.111:swig-3.0.2    
scp swig-3.0.2 drubio@192.168.56.101:/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
查看更多
登录 后发表回答