如何在 WSL(Windows Subsystem for Linux)中访问 Windows 用户目录
WSL(Windows Subsystem for Linux)在 WSL 系统内将 C: 挂载为 /mnt/c。
因此,你可以使用以下命令访问 Windows 用户的主目录
cd_mnt_c_users.sh
cd /mnt/c/Users/<username>为了找出正确的 <username> 是什么(它不总是你的普通用户名,特别是如果你使用 Microsoft 账户登录或更改了用户名),运行
ls_mnt_c_users.sh
ls /mnt/c/Users注意当你尝试访问 /mnt/c/Users/Default User 和 /mnt/c/Users/All Users 时会收到权限被拒绝错误。这完全正常,通常无关紧要。
原始来源:Windows 博客文章
Check out similar posts by category:
Windows
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow