简体   繁体   English

使用 gitbash 终端将文件从 windows 10 移动到 ubuntu 文件夹

[英]Move file from windows 10 to ubuntu folder using gitbash terminal

I am using Ubuntu on windows 10 and I need to move a file from a windows folder into ubuntu folder using the git bash terminal. I am using Ubuntu on windows 10 and I need to move a file from a windows folder into ubuntu folder using the git bash terminal.

How would I do this?我该怎么做?

You should move the file from within Ubuntu, not the other way around, because if you copy from Windows to Ubuntu, you will run into permissions errors.您应该从 Ubuntu 中移动文件,而不是相反,因为如果您从 Windows 复制到 Ubuntu,您将遇到权限错误。

Sources:资料来源:

See this for the solution: Copy Files from Windows to the Ubuntu Subsystem请参阅此解决方案: 将文件从 Windows 复制到 Ubuntu 子系统

So the moving would be from within the ubuntu shell something like:因此,移动将来自 ubuntu shell 内部,例如:

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

Actually, I'm not sure why, but you cannot move a folder from windows to WSL.实际上,我不确定为什么,但是您不能将文件夹从 windows 移动到 WSL。 It causes permission denied error on removing process (moving consists of copy & remove).它会在删除过程中导致权限被拒绝错误(移动包括复制和删除)。 But you can copy it instead using BASH.但是您可以使用 BASH 来复制它。

Steps:脚步:

  1. Put your folder in User Directory (ex. C://Users/Admin/ )将您的文件夹放在用户目录中(例如C://Users/Admin/
  2. Open your ubuntu terminal打开您的 ubuntu 终端
  3. Copy it recursively.递归地复制它。 Ex:前任:
cp -r /mnt/c/Users/Admin/AFolder ./FolderInWSL/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pygame,视频未初始化且未找到视频-在Windows 10中使用ubuntu终端 - pygame, video not initialized and no video found - using ubuntu terminal from within windows 10 从gitbash为Windows激活pyvenv - Activating pyvenv from gitbash for windows 如何使用 Linux Ubuntu 终端将图像移动到不同的目录 - How to move images to a different directory using Linux Ubuntu terminal 使用 Python 在 sharepoint 中将文件从一个文件夹移动到另一个文件夹 - Move file from one folder to another in sharepoint using Python 使用python,终端命令(ubuntu)和文件夹属性的不同大小的文件夹 - Different size folders using python, terminal commands (ubuntu) and folder properties Windows 10是否有JMESPath终端? - Is there a JMESPath Terminal for windows 10? ANSI 颜色不适用于使用 Windows 终端的 Windows 10 上的 Git Bash - ANSI color not working for Git Bash on Windows 10 using Windows Terminal 如何使用python将文件从一个文件夹移动到另一个文件夹相同的ftp - How to move file from one folder to another folder same ftp using python 使用 colorama 将 cursor 定位在 Windows 10 端子 window 中 - Positioning the cursor in Windows 10 terminal window using colorama 如何将python项目从Windows中的Netbeans移至Ubuntu - How to move python project from Netbeans in windows to Ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM