Woof (short for Web Offer One File) is a simple application for sharing files between hosts on a small local network. It consists of a tiny HTTP server that can serve a specified file for a given number of times (default is once) and then terminates.
To use woof, simply invoke it on a single file, and the recipient can access your shared file via a web browser or using a command-line web-client such as cURL, HTTPie, wget or kurly (a curl alternative) from the terminal.
One advantage of woof over other file sharing tools is that it shares files between a different operating system, or different devices (computers, smartphones, tablets etc.), provided the recipient has a web browser installed.
How to Install and Use Woof in Linux
On Debian and Ubuntu, you can easily install ‘woof‘ package from the distribution’s default repositories using apt or apt-get package manager as shown.
$ sudo apt install woof OR $ sudo apt-get install woof
On other Linux distributions, you can download the woof script using wget command and move it to a /usr/bin directory as shown.
$ wget http://www.home.unix-ag.org/simon/woof $ sudo cp woof /usr/bin/
To share a file, provide it as an argument as shown.
$ woof ./bin/bashscripts/getpubip.sh
Then woof will generate a URL (http://188.8.131.52:8080/ in this case) which your partner can use to access the file. Send the URL to the recipient. Once the recipient accesses the file, woof will shut down.
To specify a custom name, use the -O option as shown.
$ wget -O custom_name http://184.108.40.206:8080
Alternatively, you can also access the shared file from the web browser as shown (click Save File to download it).
By default, woof shares the file once, and after the recipient downloads it, woof terminates. You can set the number of time woof shares a file before it shuts down, using the -c option.
The following command will terminate woof after three downloads.
$ woof -c 3 ./bin/bashscripts/getpubip.sh
To share a directory, you can create a tarball and compress it by using (-z for gzip compression, or -j for bzip2 compression, or -Z for ZIP compression). For example:
$ woof -c 2 -z ./bin/
Check out the download file name, it should be a Gzip archive.
In addition, you can use the -U flag to tell woof to provide an upload form, allowing file uploads. The file will be uploaded to the current directory where woof was launched from:
$ woof -U
Then your partner can use the generated URL to access the upload form from a browser as shown.
After browsing and selecting the file, click the Upload button to upload files.
You can verify, that the file should be uploaded to the same directory where woof was invoked.
You can see more usage options by running:
$ man woof OR $ woof -h
Woof is a small, simple and easy-to-use HTTP server for sharing files on a local areas network.