将文件从Windows复制到Ubuntu子系统 [英] Copy Files from Windows to the Ubuntu Subsystem

查看:2818
本文介绍了将文件从Windows复制到Ubuntu子系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已启用开发人员模式并安装了Bash on Ubuntu on Windows.

I have enabled developer mode and installed Bash on Ubuntu on Windows.

我的主目录位于%localappdata%\Lxss\home\<ubuntu.username>\下,我创建了一个名为Pictures的子目录,因此完整路径应为

My home directory can be found under %localappdata%\Lxss\home\<ubuntu.username>\, i have created a sub-directory called Pictures such that the full path should be

在Windows上:C:\Users\<windows.username>\AppData\Local\lxss\home\<ubuntu.username>\Pictures

on windows: C:\Users\<windows.username>\AppData\Local\lxss\home\<ubuntu.username>\Pictures

在bash上:/home/<ubuntu.username>/Pictures

如果我使用命令touch hello.txt从bash创建文件,则可以在Windows UI中自由查看此文件并将其复制到我的桌面.但是,如果我从Windows UI创建一个新的文本文件并将其保存在C:\Users\<windows.username>\AppData\Local\lxss\home\<ubuntu.username>\Pictures中,即使我重新启动bash或Windows,在执行ls -l时该文件也不可见.

if i create a file from bash using the command touch hello.txt i can freely see this file in the windows UI and copy it to my Desktop. However, if i create a new text file from the windows UI and save it in C:\Users\<windows.username>\AppData\Local\lxss\home\<ubuntu.username>\Pictures, even if i restart bash or windows, the file is not visible when i do ls -l.

为什么bash无法在自己的主目录中看到从Windows一侧创建的文件?

Why can't bash see files created from the Windows side in it's own home directory?

编辑不是使用/mnt/c解决方案,我试图了解为什么它看不到那些文件,并且是否有补救措施,以便它将能够查看UI创建的文件,而不必尝试使用终端复制粘贴或移动文件.

EDIT Using /mnt/c is not a solution, i am trying to understand why it doesn't see those files and if there is a remedy to that so that it will be able to see UI created files, rather than trying to use the terminal to copy-paste or move files over.

推荐答案

您应该能够在/mnt目录下访问Windows系统.例如在bash中,使用它可以进入图片目录:

You should be able to access your windows system under the /mnt directory. For example inside of bash, use this to get to your pictures directory:

cd /mnt/c/Users/<ubuntu.username>/Pictures

希望这会有所帮助!

这篇关于将文件从Windows复制到Ubuntu子系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆