Open an .html file with default browser using Bash on Mac

前端 未结 8 1648
陌清茗
陌清茗 2020-12-13 17:17

So, this is what I need :

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

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

(Using

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 17:30

    i managed to open the html file with chrome by placing the file after the browser command. so,

    google-chrome-stable ./index.html
    

    although im not sure what the call would be to the default browser, if you knew it you could put it as an alias in your .bashrc and from then on, use whatever you called your alias, plus the file.

    goo ./index.html
    

    just my experience, first response

提交回复
热议问题