简体   繁体   English

如何在Windows 10开发人员模式下构建的Ubuntu上读取sh文件

[英]how to read sh files on Ubuntu built in Windows 10 developer mode

I use bash on Ubuntu on Windows 10 to open a sh file I downloaded. 我在Windows 10的Ubuntu上使用bash打开我下载的sh文件。 But when I put the sh files in my directory in Ubuntu I can't see them. 但是,当我将sh文件放在Ubuntu的目录中时,看不到它们。 I can see them and my other files in Windows directory but not in Ubuntu. 我可以在Windows目录中看到它们以及其他文件,而在Ubuntu中看不到。

Bash on Ubuntu on Windows 10 is a built in feature in Windows 10. It can be used in developer mode. Windows 10上的Ubuntu上的Bash是Windows 10的内置功能。可以在开发人员模式下使用。 It is not CMD or command prompt or whatsoever. 它不是CMD或命令提示符,也不是任何东西。

You home directory in bash is 您在bash中的主目录是

c:\Users\<Windows User>\AppData\Local\lxss\home\<linux_username>\

UPDATE: 更新:

sorry, I misread your question, you have a problem seeing these files from bash, when they are saved by Windows. 抱歉,我误解了您的问题,当Windows保存这些文件时,您无法从bash中查看这些文件。 I'm not sure how exactly this works regarding home folder, but you can access any Windows files from bash using filesystem in /mnt/ 我不确定这对于主文件夹的工作原理,但是您可以使用/ mnt /中的文件系统从bash访问任何Windows文件

So the above would be /mnt/c/Users/<Windows User>/AppData/.... etc 所以上面是/mnt/c/Users/<Windows User>/AppData/....

UPDATE 2: 更新2:

Here is more information about the problem - https://superuser.com/questions/1083962/windows-linux-subsystem-accessing-files-outside-of-ubuntu Basically, confirming what I said above - you have to use /mnt/ 这是有关该问题的更多信息-https: //superuser.com/questions/1083962/windows-linux-subsystem-accessing-files-outside-of-ubuntu基本上,确认我在上面说的内容-您必须使用/ mnt /

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM