[英]In the Ubuntu Bash shell in Windows 10, how do you open a file or directory with the default program?
Eg, if I have .java
files set to open with Notepad++, is there some command I can run like open ./Blah.java
that will open Blah.java in Notepad++, or open .
例如,如果我将.java
文件设置为使用Notepad ++打开,是否有一些命令我可以像open ./Blah.java
一样运行,它将在Notepad ++中打开Blah.java,或者open .
to open the current directory in Explorer? 在资源管理器中打开当前目录? On Mac OS X, open
is this command. 在Mac OS X上, open
是此命令。
You need something that wraps the ShellExecute function . 你需要一些包装ShellExecute函数的东西。
With Cygwin, this is cygstart
. 有了Cygwin,这就是cygstart
。
With PowerShell, this is Start-Process
. 使用PowerShell,这是Start-Process
。
You can run PowerShell from the Bash shell, but it is not ideal: 您可以从Bash shell运行PowerShell,但它并不理想:
powershell Start-Process Blah.java
This is currently a feature request for Ubuntu on Windows. 这是目前Windows上Ubuntu的功能请求 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.