将文件从Windows复制到Linux的Windows子系统(WSL) [英] Copy Files from Windows to Windows Subsystem for Linux (WSL)
问题描述
我已启用开发人员模式并在Windows的Ubuntu上安装了 Bash
.
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
: C:\ Users \< windows.username> \ AppData \ Local \ lxss \ home \< ubuntu.username> \ Pictures
在bash上:/home/<ubuntu.username>/图片
如果我使用命令 touch hello.txt
从bash创建文件,则可以在Windows UI中自由查看此文件并将其复制到我的桌面.但是,如果我从Windows UI创建一个新的文本文件并将其保存在 C:\ Users \< windows.username> \ AppData \ Local \ lxss \ home \< ubuntu.username> \ Pictures
,即使我重新启动bash或Windows,当我执行 ls -l </code>时,该文件也不可见.
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复制到Linux的Windows子系统(WSL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!