How can I run a html file from terminal? [closed]

For those like me, who have reached this thread because they want to serve an html file from linux terminal or want to view it using a terminal command, use these steps:-

  1. If you want to view your html using a browser:

Navigate to the directory containing the html file
If you have chrome installed,

Use

google-chrome <filename>.html

Or Use

firefox <filename>.html
  1. If you want to serve html file and view it using a browser

Navigate to the directory containing the html file
And Simply type the following on the Terminal:-

pushd <filename>.html;  python3 -m http.server 9999; popd;

Then click the I.P. address 0.0.0.0:9999 OR localhost:9999 (Whatever is the result after executing the above commands). Or type on the terminal :-

firefox 0.0.0.0:9999

Using the second method, anyone else connected to the same network can also view your file by using the URL: 0.0.0.0:9999

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)