Open In App

Woof – Easily Exchange Files Over a Local Network in Linux

Last Updated : 02 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In order to easily share single files between Linux systems in a home network where we don’t need to worry too much about security. Woof is an acronym for Web Offer One File.  It is used to share files over a local area network. The recipient need not have any special software installed on his system, The shared file may be downloaded using curl, get, or the user’s web browser. To share or host the file woof employs a simple HTTP server that terminates after serving the file a prescribed number of times, this number is one by default.

Installation

For Debian systems apt can be simply used to install woof

sudo apt install woof

One can also install woof using the nix package manager as some new Debian repos don’t contain woof anymore

nix-env -iA nixpkgs.woof

Usage

File sharing

In order to share a single file the user needs to only use the file path as an argument to the woof command, by default the given file will be shared once i.e. it’ll be available for download only once.

To share a file once on the default IP address and port number

woof FILE_NAME

The server will get discarded after the download completes and the link generated will expire.

The number of times a file is available for download can be increased by setting the -c flag.

To share a file more than once using the -c flag

woof -c COUNT FILE_NAME

 

The shared file can be downloaded using various methods including cURL, wget, and your normal browser. The above-generated URL (http://192.xxx.xx.x:8080/hello.txt) can be shared with the recipient, who can then paste it into a web browser to simply download the file like any other thing from the internet. Furthermore, command line utilities like cURL and wget can be used to download the provided file as well as shown below.

Downloading the shared file with wget

 

The same URL can also be visited from a web browser to download the file.

Directory sharing

If a directory is specified it gets shared as a gzip file by default. It can be changed to bzip2, zip, and no compression using -j, -Z, and -u respectively.

 woof [-i <ip_addr>] [-p <port>] [-c <count>] [-z|-j|-Z|-u] <dir>

Let’s share this directory with a few dummy files.

 

The process of downloading a shared directory is the same as downloading a shared file. Downloading the shared directory

 

 

Notice its in .tar.gz format extracting which returns us the original files

Uploads

In order to accept uploads to the woof server the -U flag can be set. It will take the user to a basic webpage where they can upload whatever file they want. This file gets saved in the same directory where the woof server was launched from. We can take files from other people too using the -U flag

woof -U

 

It automatically generates a basic web form to upload a single file.

 

Sharing woof

Woof can share itself on other people’s computers when they visit the given URL. The -s flag allows other people to just visit the given URL and woof will get automatically downloaded onto their systems.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads