Serving HTTP from your Linux terminal

There is a very useful python module called SimpleHTTPServer that lets you create a webserver instantly. Say you have a huge file (50-60gb) and you want to send it to someone across the campus, then you have a use for SimpleHTTPserver.

First get to know the hostname of your server, just type hostname and press enter, it will return yourhostname

Then type,

python -m SimpleHTTPServer

That’s it! you can now access all your files in that directory through browser using this url:

http://yourhostname:8000/

It will stay as long as you let that command run (to kill it just type Ctrl + C).