Aug 4, 2016

Easily Share Files From The Command Line With

If you prefer doing things from the command line, is for you. Using it, you can easily share a file from the command line, without installing anything. Well, cURL or Wget are required, but you probably already have them installed.

The service is free, allows uploading files up to 10 GB in size, and it stores the files for 14 days. In my test, it was also very fast.

If you want to use with your own server, the code is available on GitHub.

To use, you'll need to install cURL. In Debian-based Linux distributions (Ubuntu, Linux Mint, etc.), use the following command to install it:
sudo apt install curl

To upload a file to and get a shareable URL, use the following command:
curl --upload-file ./myfile.txt
Replacing "myfile.txt" with the file you want to share.

The shared file can be previewed in the browser, and can be directly downloaded via the command line (e.g. using "curl -O").

To make it even easier, you can use a Bash (should also work with Zsh) alias. To do this, open ~/.bashrc with a text editor, and paste this:
transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/\ncat /tmp/ | transfer"; return 1; fi 
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "" >> $tmpfile; else curl --progress-bar --upload-file "-" "$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
Then save the file and run the command below to source the ~/.bashrc file:
. ~/.bashrc
(there's a dot, then a space before ~/.bashrc)

That's it. You can now simply use "transfer" to upload a file, like so:
transfer myfile.txt

Here's a screenshot too (screenshots of commands may be useless, but this article needs a preview on Google+ and Facebook):

For more examples, including using Wget instead of cURL, uploading multiple files, encrypting the files before uploading them, upload files to be scanned for malware or viruses using Clamav or VirusTotal, and more, see the website.

There are quite a few similar services, but for smaller files, like,, etc.

via Web Upd8 - Ubuntu / Linux blog