Facebook

Sharing files in Linux.


Wanna Share some file with your friend ? Here are three methods.

1. The traditional way. Transfer files to Pen Drive and then your friend copy it to their system. This is the best way to share if both system are not in same network.

Cons - 

  • File is copied 2 times.
  • What if file size is more than size of pen drive.


2. Install apache 2. 


  • Run the command $sudo apt-get install apache2 
  • This will install apache2 on your system. A directory /var/www is created.
  • Place the files you want to share inside this directory.
  • change the permission of files to 644.  $chmod 644 filename
  • Ask your friend to open the browser and in the address bar type your system's IP address.
  • List of all files available in your /var/www folder will be displayed. Download by clicking the file.


3. Install Python.
  • First of all install python if already not installed.
  • Goto the directory where your files-to-be-shared are located. $ cd folder-name
  • now run this command -   $ python -m SimpleHTTPServer [port]
Ignore first two lines after command. These are just warnings.

  • port part is optional . If not provided server will run on default port i.e. 8000
  • Now ask your friend to type in address bar  :

type ip-address : port in browser



 If there are multiple files to be shared then zip them all and place in the folder.






No comments:

Post a Comment