Linux 中我的 Windows 文件夹在哪里?

Where is my Windows folder in Linux?

我刚刚在我的 windows 10 中安装了 Ubuntu。我想在我的 windows 和 Linux 之间共享数据。

但我无法从 windows 中找到 Linux 文件夹,也无法从 Linux 中找到 windows 文件夹。有没有办法互相访问?我从 windows 商店安装了 Ubuntu。

windows 驱动器将安装在 WSL 中的 /mnt 位置

在 bash windows

中访问 C 驱动器
ls -l /mnt/c

首先,术语问题:文件夹只是一个 GUI 工件。什么Linuxfile systems deal with are directories.

I just installed Ubuntu in my windows 10.

这还不清楚。 Operating systems (both Ubuntu & Windows) are running -by definition- above the bare metal (perhaps a VM emulating the bare metal) and are providing services and abstractions to applications. So you cannot run one OS above another (except in a VM or some compatibility layer). I understand that you have installed both Ubuntu and Windows on your computer, in different disk partitions, and that you choose which OS you are using at boot time (perhaps thru some grub 菜单)。

然后,详细了解 WSL (but don't confuse WSL with Ubuntu). It could be relevant (but you might not have it, if your Windows is not recent or if you have not installed it). If you use WSL you are not running Ubuntu (e.g. because you are not using a Linux kernel), even if you could run most Ubuntu executables with WSL (but probably not all of them; it is rumored that Xorg or GTK 应用程序不能 运行 在 WSL 下)。

最后,您可能想要分享一些 ext4 file system and access it from Windows. Then you simply need some ext4 driver for Windows, such as ext2fs(但我猜 WSL 提供了接近的东西)。

网络搜索 ext4 on windows 给出了很多相关答案,特别是 this 一个。

如果您的 Linux 文件系统不是 ext4(使用 mount(8) 命令检查 mount -l),请根据您的文件系统类型调整我的回答。

I would like to share the data between my windows and Linux.

一个合理的方法是为此设置一个专用磁盘分区并在其上使用一些文件系统(可能是 ext4,或者可能是 NTFS 或 VFAT),可以在 Windows 和 [=41] 上读取=].你当然想避免从 Windows 中弄乱你的 Linux 系统文件(即使是错误的)。

如果你想从 Ubuntu(不是 WSL!)读取一些 Windows 分区,你应该考虑在 Linux 上 mounting 它(例如作为 NTFS)。你仍然应该避免从 Linux.

中弄乱 Windows 系统文件