gpt4 book ai didi

windows - 我在 bash for windows 中看不到粘贴的文件

转载 作者:可可西里 更新时间:2023-11-01 14:48:25 25 4
gpt4 key购买 nike

我在学校从事一个编程项目,并决定尝试一下 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com