linux - 这是将下载的文件 scp 到 Ubuntu 的正确语法吗?

标签 linux ubuntu

我下载了我需要迁移到 Ubuntu 的最新版本的 swig。我希望有人可以帮助确定我的语法的哪一部分不正确。我已经尝试了多种变体,但我似乎不太能写出来。

我试过了

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 上找到的指示,转载于此:

# 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。我已经检查了我所在的本地机器,并确认我在桌面目录中。我的用户名是正确的,路径是正确的。我假设错误是目的地。我的假设是错误的吗?

最佳答案

正确的语法是:

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

关于linux - 这是将下载的文件 scp 到 Ubuntu 的正确语法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24531564/

相关文章:

haskell - 安装 gtk2hs-buildtools 的问题

linux - ubuntu/bash下递归重命名文件和目录

c - 调用两次时从串口读取失败

linux - git over ssh 第二个用户无法克隆

ubuntu - 用于动态创建虚拟网络接口(interface)的 Bash 脚本

java - 如何在我的 ubuntu 中找到 java JPS?

python 程序不工作 apt-get install xvfb

c - Linux内核的list.h

linux - 在 Linux x86_64 系统调用和 int 0x80 相关吗?

python - 我的 Python 代码有多少个线程?