从Cygwin打开一个文件(Open a file from Cygwin)

编程入门 行业动态 更新时间:2024-10-28 07:20:54
从Cygwin打开一个文件(Open a file from Cygwin)

在cygwin中有相当于OSX open命令。 open打开一个包含该类型的默认应用程序的文件。

我想做一些类似的事情

$ magic-command file.xls #excel opens as if file.xls would have been double-clicked $ magic-command file.txt #notepad opens as if file.txt would have been double-clicked

你得到这个想法?

基本上就像一个“cygwin-double-click”命令。

Is there an equivalent to OSX open command in cygwin. open opens a file with the default application for that type.

I want to do something like

$ magic-command file.xls #excel opens as if file.xls would have been double-clicked $ magic-command file.txt #notepad opens as if file.txt would have been double-clicked

You get the idea?

Basically something like a "cygwin-double-click" command.

最满意答案

您也可以使用cygwin实用程序:

cygstart <your file>

要使OSX类似的东西将以下内容添加到您的bashrc中

alias open='cygstart'

不要忘记查看cygstart的手册页。

You can also use the cygwin utility:

cygstart <your file>

To make things OSX-like add the following to your bashrc

alias open='cygstart'

Don't forget to check out the man page for cygstart.

更多推荐

本文发布于:2023-07-26 03:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1270668.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   Cygwin   file   Open

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!