Skip to main content
p. 316

12.1 Quick Copy

Let’s say you want to copy a file (or files) from your Linux machine to another one on your personal network, and you don’t care about copying it back or anything fancy—you just want to get your files there quickly. There’s a convenient way to do this with Python. Just go to the directory containing the file(s) and run:

$ python -m SimpleHTTPServer

This starts a basic web server that makes the current directory available to any browser on the network. By default, it runs on port 8000, so if the machine you run this on is at address 10.1.2.4, point your browser on the destination system to http://10.1.2.4:8000 and you’ll be able to grab what you need.

warning

This method assumes that your local network is secure. Don’t do this on a public network or any other network environment that you do not trust.