How to safely transfer files from one Linux system to another through command line

Last Updated on April 18, 2021 by admin

While working on the command line in Linux, there may be situations where-in you may want to quickly and safely transfer a file from your system to some other system, irrespective of where the destination is.

If you're stuck in this kind of situation, and are looking for a command line tool that offers all these features, you'll be glad to know that such a solution exists, and we'll be briefly explaining it here.

Magic Wormhole

Magic Wormhole - yes, that's the name of the tool. The way it works is: you send a file using the tool, and while the transfer is in progress, the tool gives you a code that you share with the other party. Using the code, the person at destination easily receives the file.

Here's how the official documentation explains the tool's working:

"This package provides a library and a command-line tool named wormhole, which makes it possible to get arbitrary-sized files and directories (or short pieces of text) from one computer to another. The two endpoints are identified by using identical "wormhole codes": in general, the sending machine generates and displays the code, which must then be typed into the receiving machine."

"The codes are short and human-pronounceable, using a phonetically-distinct wordlist. The receiving side offers tab-completion on the codewords, so usually only a few characters must be typed. Wormhole codes are single-use and do not need to be memorized."

Installation and usage

On Ubuntu 16.04, the tool was successfully installed using the following command:

sudo snap install wormhole

Detailed installation instructions for other Ubuntu versions (as well as other Linux distros) are mentioned here.

Once the installation process is successful, following is the generic syntax of the command the sender needs to execute:

wormhole send [file-name]

And following is the command the receiver needs to run:

wormhole receive

The following screenshot shows the command in action at both sender and receiver ends:


For more information on the tool, head to its GitHub page.


Leave a Comment