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

后端 未结 15 1233
余生分开走
余生分开走 2020-12-25 09:47

I would like to open a file (index.html) in the current directory with Google Chrome or Chromium from a bash terminal (I\'m using Linux Mint 15). What is the command? I\'v

相关标签:
15条回答
  • 2020-12-25 10:26

    Just type in the program name followed by the file:

    google-chrome {file-path}
    

    ex:

    google-chrome ~/index.html
    
    0 讨论(0)
  • 2020-12-25 10:26

    On Ubuntu 12.04, at least, it's /opt/google/chrome/chrome; I've also got a symlink to it at /usr/bin/google-chrome

    0 讨论(0)
  • 2020-12-25 10:27

    If Chrome is your main browser, just use

    see your_file.html
    
    0 讨论(0)
  • 2020-12-25 10:33

    You can open a file using below terminal commands (Linux)

    1. Open in New Tab google-chrome < filepath >
    2. Open in New Window google-chrome --new-window < filepath >
    3. Open in Incognito mode google-chrome --incognito (--incongnito-mode) < filepath >
    <filepath> = localhost/test/../filename.html
    
    0 讨论(0)
  • 2020-12-25 10:33
    1. In bash or git CMD, make sure you are in your project directory/folder
    2. Type start index.html
    3. Hit Enter. Voila :-) you're done

    This worked for me. Hope it does for you too.

    0 讨论(0)
  • 2020-12-25 10:34

    Try

     open {filename}
    

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

    0 讨论(0)
提交回复
热议问题