Terminal Google-Chrome – Creating Command to Open File

google-chrometerminal

I want to create command in terminal that would allow me to use

chrome index.html

and have the the given file open in Google Chrome.

How can I get this working?

Best Answer

You can use the open command with the -a flag to open a file or location in Chrome:

open -a "Google Chrome" index.html

This also works with URLs, i.e. open -a "Google Chrome" http://www.apple.com.