Easy python command to run a web server from a specific directory. Great for transferring files!

I am sure this is in a thousand places, however when commands don’t show up in my bash history, I have to go find them elsewhere.

python -m SimpleHTTPServer

This simple one liner will spawn Python’s SimpleHTTPServer which will serve the files in the current working directory that the command is executed in.

I’ve been in the process of setting up my official homelab and have been in need of transferring files, that are located on local or external disks, to the new VM clients. I don’t want to use the NAS as a temporary medium, so the next best thing is to spawn up this simple server from the directory that the files exist in.