Skip to content

Serve current directory using HTTP with a single command

Serve current directory using HTTP with a single command

Answer:

Sometimes, you want to share some files in a given directory in your Linux system to other people, you might consider setup a NFS, Samba, FTP or so.

However, the easiest method is to export the directory using HTTP, with the help of Python.

E.g.

 # cd /data/
python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...

Now people can access the web server at port 8000 of your system's IP address, to access the /data directory.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  1. How to check which directory used up most of the disk space?
  2. How to get the IP address assigned to eth0 by a single command
  3. Quick and easy SMTP server with Python
  4. How to mirror a directory to a remote server over SSH?
  5. How to mount a NFS share?

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*