I have enabled developer mode and installed Bash on Ubuntu on Windows
.
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
on windows: C:\Users\<windows.username>\AppData\Local\lxss\home\<ubuntu.username>\Pictures
on bash: /home/<ubuntu.username>/Pictures
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
.
Why can't bash see files created from the Windows side in it's own home directory?
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.
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
Hope this helps!
You should only access Linux files system (located in lxss folder) inside WSL, DO NOT create/modify any files in lxss folder in Windows, it's dangerous and WSL will not see these files.
If you want files can be shared between WSL and Windows, please put the file outside of lsxx folder. You can access them via drvFS (/mnt
) such as /mnt/c/Users/youusername/files
within WSL and modify them in Windows.
For details and why, see: https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
来源:https://stackoverflow.com/questions/42586120/copy-files-from-windows-to-the-ubuntu-subsystem