【问题标题】:Move file from windows 10 to ubuntu folder using gitbash terminal使用 gitbash 终端将文件从 Windows 10 移动到 ubuntu 文件夹
【发布时间】:2020-08-30 18:04:01
【问题描述】:

我在 Windows 10 上使用 Ubuntu,我需要使用 git bash 终端将文件从 windows 文件夹移动到 ubuntu 文件夹。

我该怎么做?

【问题讨论】:

  • 您可能想使用scp 将文件复制到另一台主机。
  • 你在哪里运行 ubuntu?在同一台机器上?像这样:ubuntu.com/tutorials/tutorial-ubuntu-on-windows#1-overview 或者你在运行两台单独的机器?你能用 git bash 访问 windows 文件夹吗?
  • 我在同一台机器上运行

标签: python linux windows image ubuntu


【解决方案1】:

你应该从 Ubuntu 中移动文件,而不是相反,因为如果你从 Windows 复制到 Ubuntu,你会遇到权限错误。

来源:

请参阅此解决方案:Copy Files from Windows to the Ubuntu Subsystem

所以移动将是 从 ubuntu 外壳中类似于:

mv /mnt/<windows_drive_letter>/<path>/<filename> .

【讨论】:

  • 非常感谢,我在 windows 10 上使用 ubuntu
【解决方案2】:

实际上,我不确定为什么,但是您不能将文件夹从 Windows 移动到 WSL。它会在删除过程中导致权限被拒绝错误(移动包括复制和删除)。但是您可以使用 BASH 来复制它。

步骤:

  1. 将您的文件夹放入用户目录(例如C://Users/Admin/
  2. 打开你的 ubuntu 终端
  3. 递归地复制它。例如:
cp -r /mnt/c/Users/Admin/AFolder ./FolderInWSL/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-12
    • 2021-08-02
    • 1970-01-01
    相关资源
    最近更新 更多