这是将下载的文件 scp 到 Ubuntu 的正确语法吗? [英] Is this the correct syntax to scp a downloaded file into Ubuntu?
问题描述
我下载了需要迁移到 Ubuntu 的最新版本的 swig.我希望有人能帮助确定我的语法的哪一部分不正确.我已经尝试了许多变体,但我似乎不太能写出来.
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.
我试过了
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
我已经尝试实施我在 askubuntu.com 上找到的指示,这里转载:
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
我要做的就是将本地计算机桌面上下载的 swig-3.03 复制到 Ubuntu.我已经检查了我所在的本地机器,并确认我在桌面目录中.我的用户名是正确的,路径是正确的.我假设错误是目标点.我这样假设有错吗?
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?
推荐答案
正确的语法是:
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
没有空格!
用法是用于复制本地到远程:
scp /path/to/my_local_file user@host:/path/to/my_copy_file
或复制远程到本地:
scp user@host:/path/to/my_remote_file /path/to/my_copy_file
这篇关于这是将下载的文件 scp 到 Ubuntu 的正确语法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!