通过PowerShell/cmd为Linux应用程序调用Windows子系统 [英] Calling Windows subsystem for Linux apps through PowerShell/cmd

查看:61
本文介绍了通过PowerShell/cmd为Linux应用程序调用Windows子系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着最近推动Windows内部人员构建14316,我们有了Linux的Windows子系统(测试版),该子系统允许在Windows上运行Ubuntu Linux CLI软件.可以通过在Windows PowerShell中运行 bash 命令或通过在Windows上的Ubuntu上运行Bash"应用程序来启动它.

With recently pushed for Windows insiders build 14316 we have Windows subsystem for Linux (beta) that allows to run Ubuntu Linux CLI software on Windows. It can be launched by running bash command inside Windows PowerShell or by "Bash on Ubuntu on Windows" app.

所以,我的问题是关于第一种方法的.我们可以从PowerShell启动 bash ,但是没有其他ubuntu CLI应用程序可用.您如何工作?假设我希望在不使用bash的情况下启动 zsh .

So, my question is about first way. We can launch bash from PowerShell, but none other ubuntu CLI application is available from it. How do you make one work? Let's say that I want zsh to be available to launch without using bash.

推荐答案

根据

第三,请注意,Bash和Linux工具无法与Windows应用程序和工具进行交互,反之亦然.因此,您将无法从Bash运行记事本,或从PowerShell在Bash运行Ruby.

Third, note that Bash and Linux tools cannot interact with Windows applications and tools, and vice-versa. So you won’t be able to run Notepad from Bash, or run Ruby in Bash from PowerShell.

更多在Microsoft/CommandLine-Documentation#32 中,这与从Bash中运行win32命令的相关功能有关:

More in Microsoft/CommandLine-Documentation#32, which is about the related ability to run win32 commands from within Bash:

请放心,将来我们将研究互操作性故事,但我们不会在Windows 10周年更新时间范围内添加此功能.

Rest assured, we're going to be looking into the interop story in the future, but we won't be adding this capability in the Windows 10 Anniversary Update timeframe.

使用 bash -c 选项运行特定命令可能会有些运气.

You might have some luck with the -c option of bash to run specific commands.

这篇关于通过PowerShell/cmd为Linux应用程序调用Windows子系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆