Windows 10最终将提供对Linux文件的轻松访问

Ubuntu and openSUSE shortcuts in Windows 10's Start menu

Windows 10’s April 2019 Update brings a long-awaited feature: Support for easily accessing, viewing, and even modifying Windows Subsystem for Linux (WSL) files from File Explorer or via the command line.

Windows 10的2019年4月更新带来了期待已久的功能:支持通过File Explorer或通过命令行轻松访问,查看甚至修改Windows Linux子系统(WSL)文件

Previously, it was possible to find your Linux files in your AppData folder, but Microsoft warns against that. Modifying files here would break things. Now, there’s an easier, official way to access these files with Windows tools—without the risk of breaking anything!

以前,可以在AppData文件夹中找到Linux文件,但Microsoft对此警告。 在这里修改文件会破坏事情。 现在,有一种使用Windows工具访问这些文件的简便,正式的方法,而不会损坏任何东西!

Microsoft’s Craig Loewen explains how it works: Rather than accessing these files directly, Windows runs a Plan 9 server as part of the WSL software in the background. Windows 10 has “a Windows service and driver that acts as the client and talks to the Plan9 server.” That server translates your file operations and handles Linux metadata such as file permissions, ensuring everything works properly even when you access a file with a Windows tool. But that’s just the complicated stuff that happens in the background, and you don’t have to think about it.

微软的Craig Loewen解释了它的工作原理:Windows而不是直接访问这些文件,而是在后台运行作为WSL软件一部分的Plan 9服务器。 Windows 10具有“充当客户端并与Plan9服务器对话的Windows服务和驱动程序。” 该服务器可以转换文件操作并处理Linux元数据(例如文件权限),即使在使用Windows工具访问文件时,也可以确保一切正常。 但这仅仅是在后台发生的复杂事情,您无需考虑。

You can open a File Explorer window directly in the current directory from within a Linux shell environment. Just type the following command into the Bash shell:

您可以在Linux Shell环境中直接在当前目录中打开“文件资源管理器”窗口。 只需在Bash shell中键入以下命令:

explorer.exe .

You can work with files normally from here. Use drag and drop, copy and paste them, or even open them directly in Windows applications to modify them.

您可以从这里正常使用文件。 使用拖放,复制和粘贴它们,甚至直接在Windows应用程序中打开它们来修改它们。

A Linux home directory in File Explorer
Microsoft
微软

Microsoft may change how this works in the future. But, for now, you can also type following path into an Explorer window to access a Linux distribution’s files:

Microsoft将来可能会更改其工作方式。 但是,现在,您还可以在“资源管理器”窗口中键入以下路径来访问Linux发行版的文件:

\\wsl$\<running_distro_name>\

In other words, if you’re running Ubuntu 18.04’s Bash shell, you’d type:

换句话说,如果您正在运行Ubuntu 18.04的Bash shell,则应输入:

\\wsl$\Ubuntu-18.04\

This also works from the command line, of course. In PowerShell or the Command Prompt, the command cd \\wsl$\Debian\ changes to the root directory of your installed Debian system.

当然,这也可以从命令行使用。 在PowerShell或命令提示符中,命令cd \\wsl$\Debian\更改为已安装的Debian系统的根目录。

Linux files displayed in PowerShell
Microsoft
微软

Windows Subsystem for Linux users have wanted this feature for a long time. Back in 2016, Microsoft’s Rich Turner wrote that he had to warn people not to access their Linux files in File Explorer at least two or three times per day. Now, there’s finally a way to work with these files without the risk of breaking something.

Linux用户的Windows子系统很久以来一直希望使用此功能。 早在2016年,微软的Rich Turner写道,他必须警告人们每天至少至少两到三次不要在File Explorer中访问其Linux文件。 现在,终于有了一种处理这些文件的方法,而不会破坏某些文件。

翻译自: https://www.howtogeek.com/fyi/windows-10-will-finally-offer-easy-access-to-linux-files/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值