使用Mac上的Bash默认浏览器中打开一个.html文件 [英] Open an .html file with default browser using Bash on Mac

查看:811
本文介绍了使用Mac上的Bash默认浏览器中打开一个.html文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,这正是我需要的:

So, this is what I need :

让我们说我有一个 index.html的文件。

Let's say I have an index.html file.

我如何告诉终端使用默认浏览器打开它?

How do I tell the terminal to open it using the default browser?

(使用AppleScript,BASH,...?)

(Using AppleScript, BASH,...?)

推荐答案

这包含目录的index.html,尝试...

from the directory containing index.html, try...

open ./index.html

打开命令打开一个文件(或目录,或URL)。打开包含在MacOSX上。细节和选项可以使用发现

the open command opens a file (or directory, or URL). open is included with MacOSx. specifics and options can be found using

man open

请注意:默认的应用程序是通过LaunchServices确定。

note: default application is determined via LaunchServices.

这篇关于使用Mac上的Bash默认浏览器中打开一个.html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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