【问题标题】:Receiving a no such file or directory error: gcloud compute copy-files onto instance from local machine收到无此类文件或目录错误:gcloud compute copy-files to instance from local machine
【发布时间】:2015-05-15 10:51:13
【问题描述】:
gcloud compute copy-files /Users/myusername/Pictures/IMG_0382.JPG myusername@my-instance:/var/www --zone asia-east1-c

/Users/myusername/Pictures/IMG_0382.JPG: No such file or directory
ERROR: (gcloud.compute.copy-files) [/usr/bin/scp] exited with return code [1].

我正在将文件目录复制粘贴到我的本地终端中。什么是交易?我必须修改.bash 文件吗?

【问题讨论】:

  • 看看How to Ask
  • 显然您尝试复制的文件不存在。 Bash 的启动文件不叫.bash,但这似乎与 Bash 环境无关。
  • 也许您在错误的终端窗口中运行命令。您需要有一个本地终端窗口(只需在要从中复制文件的计算机上运行 bash),显然,它需要安装 gcloud 工具链。

标签: macos bash terminal gcloud


【解决方案1】:

此命令是成功还是失败: ls -ld /Users/myusername /Users/myusername/Pictures/IMG_0382.JPG

复制和粘贴很可能没有达到您的预期。

【讨论】:

  • ls -ld /Users/myusername/Pictures/IMG_0381.JPG -rw-------@ 1 myusername 员工 439722 2014 年 7 月 17 日 /Users/myusername/Pictures/IMG_0381.JPG跨度>
【解决方案2】:

所以,原来我不在正确的终端。您必须打开一个新的终端窗口,cd 到适当的目录(包含所需上传文件的文件夹),然后发出 strong>gcloud 计算复制文件本地... yada yada。如果您已经连接到您的实例,那很好,只需打开一个新的终端窗口。

【讨论】:

    【解决方案3】:

    GCP 文档可以在here 找到。

    为了让它发挥作用,我必须:

    1. 包括sudo 以获得权​​限
    2. 删除文档中指定的~
    3. 添加我的虚拟机的区域

    代码:

    sudo gcloud compute scp [LOCAL_FILE_PATH] [INSTANCE_NAME]:/ --zone [INSTANCE ZONE]
    

    例子

    sudo gcloud compute scp /Users/jb/Downloads/cudnn-8.0-linux-x64-v7.tar instance-1:/home/jb --zone us-west
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-04
      • 1970-01-01
      • 2021-12-19
      • 2016-02-26
      • 1970-01-01
      • 2013-05-13
      • 2022-11-20
      • 1970-01-01
      相关资源
      最近更新 更多