Instant LAN File Sharing with one command in Ubuntu
This post was written by admin on September 6, 2009
Posted Under: Internet
Posted Under: Internet
If you want to share files over the LAN quickly and easily and do not want to mess with apache or any http daemon.
You just need to openup a terminal window and run this command:
python -c "import SimpleHTTPServer; SimpleHTTPServer.test();"
or
python -m SimpleHTTPServer
For example,in terminal navigate to Download folder and run the command:
wraith@wraith-desktop:~/Download$ python -c "import SimpleHTTPServer; SimpleHTTPServer.test();"
Serving HTTP on 0.0.0.0 port 8000 ...
People within your LAN,should get your /home/username/Download folder by type yourip:8000 in browser.
You can also make this command more simpler by adding this line to .bashrc or .bash_aliases in your home folder(Ctrl+H to view hidden files).
alias LANshare='python -c "import SimpleHTTPServer; SimpleHTTPServer.test();"'
Now,reboot and you can run the command LANshare anywhere on your file system and share those files.
Related posts:
- Simple Http Server support uploading files from Windows in Ubuntu
- Easy file receiving from friends on the internet with Droopy
- feh – lightweight command-line (command console) image viewer for Linux
- Sharing Desktop Files with Giver
- Nautilus-terminal,integrate command line interface into Nautilus file browser
Tags: network


Reader Comments
thanks, great tip.
also you don’t need to reboot your system after editing .bashrc
just issues this command:
source .bashrc
[Reply]
Too damn cool,
python does it again
Thanks man
[Reply]
Awesome finding, quickest way to do it. Very helpful article. Thanks for sharing. Python rocks.
[Reply]
Awesome, simply awesome !!!
[Reply]