- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在学校从事一个编程项目,并决定尝试一下 Bash for windows。我下载了该项目的框架文件并将它们粘贴到我的 bash 主文件夹所在的文件夹中。当我打开终端并进入文件夹时,它显示好像那里什么也没有,即使我在正确的文件夹中。如何让文件显示出来?
最佳答案
编辑:到目前为止,实际上有一种受支持的方式来访问这些文件。你必须使用 \\wsl$\Legacy
“网络”共享。例如,您可以使用 \\wsl$\Legacy\home\<username>
在 Windows 中访问您的 WSL 主文件夹。 .不过,您不应该直接访问 lxss 目录。
You are not supposed to touch the LXSS folder ever.那里的文件使用普通 Windows 应用程序无法理解的特殊属性来提供 NTFS 本身无法提供的完整 Linux 文件系统的功能。
There is one hard-and-fast rule when it comes to Bash on Windows:
DO NOT, under ANY circumstances, create and/or modify Linux files using Windows apps, tools, scripts, consoles, etc. Creating/changing Linux files from Windows will likely result in data corruption and/or damage your Linux environment requiring you to uninstall & reinstall your distro! Note: Your “Linux files” are any of the files and folders under %localappdata%\lxss – which is where the Linux filesystem – distro and your own files – are stored on your drive
如果要将文件复制到不在 /mnt
下的 WSL 目录中,然后使用 WSL 复制文件,即使用 cp /mnt/c/original/folder/of/the/file.txt ~/
例如。
更高级的替代方法是在 WSL 中启动本地 SSH 服务器并使用 Win-SSHFS将 WSL 根安装为 Windows 中的驱动器。这样,文件访问将通过 WSL。
关于windows - 我在 bash for windows 中看不到粘贴的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41704972/
我是一名优秀的程序员,十分优秀!