从 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-双击”命令。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您还可以使用 cygwin 实用程序:
要使内容类似于 OSX,请将以下内容添加到您的 bashrc
不要忘记查看 cygstart 的手册页。
You can also use the cygwin utility:
To make things OSX-like add the following to your bashrc
Don't forget to check out the man page for cygstart.
您可以使用 CMD 中的 start 命令,如下所示:
You can use the start command from the CMD like this:
也有效。 好处是
在当前目录中打开一个 Windows 资源管理器窗口。 但随后
做了同样的事情并做了更多的事情,但我发现“explorer”更容易记住。
works too. What is nice is
opens a windows explorer window in the current directory. But then
does the same thing and does more, but I find 'explorer' slightly easier to remember.
我在Win7中使用Cygwin。 我可以通过 ccygwin 命令行在 Windows 上运行文件。
当您运行此命令时,您的文件将在 Windows 中打开。
I am using Cygwin in Win7. I can run file on windows through ccygwin command line.
when you run this command your file will open in windows.
在 Windows 命令行解释器 (cmd.exe) 下,支持启动命令。 我知道有人在 cygwin 中实现了 start 。 您可以在此处找到有关它的页面。
您也可以简单地使用以下参数调用 cmd.exe(通常位于 /cygdrive/c/windows/system32/cmd.exe 中) cmd /c "start yourfile.file"
Under the Windows command-line interpreter (cmd.exe) there is support for the start command. I know of somebody who implemented start in cygwin. You can find the page about it here.
You could also simply call cmd.exe (usually located in /cygdrive/c/windows/system32/cmd.exe) with the following arguments cmd /c "start yourfile.file"
如果像我一样,您在 Windows 计算机上使用 putty 在本地 ssh 到 Cygwin,因为 cmd.exe 是一个糟糕的控制台,您可能需要更改 sshd 服务以允许它访问本地桌面(这只适用于某些windows 风格)在 sshd windows 服务登录属性下。
If, like me, you are using putty to ssh locally on your windows machine to Cygwin as cmd.exe is a terrible console, you may want to change your sshd service to allow it to access the local desktop (this will only work on certain windows flavors) under the sshd windows service Logon properties.
是的,有一个与 Windows 等效的工具,请尝试使用
xdg-open
Yes, there is an equivalent to Windows, try with
xdg-open <your file>