Friday tip: How to quickly serve files from any directory

This tip is very short, but in my opinion very useful. I used it so many times and it saved me in some situations.

When you need to share files from a directory just go this directory and run:

now you can see the list of files in your browser. You may access it on port 8000 via url:

http://<your_pi_ip>:8000

If you want it to listen on different port just run:

Using SimpleHTTPServer you can even host simple HTML websites. It’s not recommended for longer period but in some situations it may be useful.