How do I open a file with Chrome from the command line? How do I open a file with Chrome from the command line? google-chrome google-chrome

How do I open a file with Chrome from the command line?


Just type in the program name followed by the file:

google-chrome {file-path}

ex:

google-chrome ~/index.html


Try

 open {filename}

if it's an .html file it should open in your default browser


From the bash shell (on Windows), you can use:

start myFilename.html

and to open a folder:

explorer "C:\Program Files\Git"

Added for reference, since my search landed here, too.