LINUX

How to Transfer Files Between Linux, Android, and iOS Using qrcp

0

File-sharing apps make it easier to transfer files between mobile devices and computers. But while these apps generally work well, they tend to cause compatibility issues with certain platforms owing to their limitations.

This is where qrcp comes in. Qrcp is a file transfer utility that works via the terminal and relies on Wi-Fi to carry out file transfer. As a result, you can use it to share files between any computer and mobile phone, irrespective of their operating systems.

Here's a guide detailing qrcp and the steps to use it for transferring files between your Linux computer and a mobile device.

What Is qrcp?

Qrcp is a command-line tool that lets you transfer files over Wi-Fi using a QR code. It's compatible with all major Linux distros and mobile operating systems (Android and iOS), so you can use it to transfer files between your computer and mobile phone and vice-versa without running into compatibility issues.

How Does qrcp Work?

Qrcp operates solely through the terminal. For this, it first binds a web server to one of the ports on your Wi-Fi interface and creates a handle for the same, which then functions based on whether the device is sending or receiving files.

As a sender, qrcp uses the handler to generate a QR code, encoding your device's IP address, port number, and send instructions. The receiver needs to then scan this QR code to access the download page.

On the other hand, when the computer wants to receive files from a mobile device, the handler generates a QR code encoded with IP address, port number, and receive instructions. The sender has to scan the QR code on their mobile device to access qrcp's file sharing service, where they can choose the files they want to transfer.

How to Install qrcp on Linux

Installing qrcp on Linux is pretty easy, and you can do this on any Linux distro. Visit the qrcp releases web page and download the latest TAR.GZ archive to your computer.

Download: qrcp

Then, open the terminal and navigate to the directory where you've downloaded the file. Run the following command to extract the archive:

tar -xf qrcp-*.tar.gz

Copy the extracted binary over to /usr/local/bin:

sudo mv qrcp /usr/local/bin

Finally, set the execution permission for qrcp with:

sudo chmod +x /usr/local/bin/qrcp

Once finished, run:

qrcp version
Verifying-qrcp-installation

If it returns a version number, qrcp is installed successfully on your Linux computer, and you can start using it. If not, you might need to go through the steps again.

How to Use qrcp to Transfer Files

As we described in the working section above, qrcp can do both: send and receive files. So depending on what operation you want to perform, you need to follow the steps accordingly.

Sending Files Using qrcp

When we talk about sending files with qrcp, it implies sending files from your Linux computer to a mobile device. So in the event that you want to share files from your computer to your mobile phone or tablet, you can do so using the following steps:

First, connect to a Wi-Fi network. Then open the terminal and run the following command:

qrcp name_of_the_file

For example:

qrcp TextFile.txt
Generating-file-sending-QR-code

If you want to share multiple files, you can either create a zip yourself or let qrcp do that for you. For the latter, you simply need to enter the command in the following syntax:

qrcp file_name_1 file_name_2

For example:

qrcp TextFile1.txt TextFile2.txt

On the other hand, to generate the archive yourself, run:

qrcp --zip file_name_with_extension

You can zip a single file using the aforementioned command syntax.

Moreover, qrcp also lets you share an entire folder, which can come in handy when you want to share multiple files. For this, you need to simply replace the file name with the folder name in your command.

For instance, if you want to transfer a folder named Documents, you'll have to run:

qrcp Documents

As soon as you run the qrcp command—for file or folder transfer—the program will generate a QR code.

On your smartphone, open the QR scanner. On Android, you can use Google Lens (or any other app), whereas, on iPhone, you have the functionality built into the camera app.

Point the scanner app to the QR code on your terminal. Depending on which phone and app you use, you'll see an option to open the link in the QR code. Tap on it to visit that link and hit the Download/Save button to download the file to your device.

Ideally, qrcp quits the server as soon as the receiving device downloads the files. However, you can choose to keep it alive if there's a need to transfer the same file to multiple devices.

To do this, modify your command with the –keep-alive flag as shown in the command below

qrcp --keep-alive file_or_document_name

Receiving Files Using qrcp

Receiving files using qrcp basically means downloading files sent from a mobile device onto your Linux machine. So, if there's a need to share files from your smartphone to your computer, you can do so with the help of the following steps:

First, make sure both the devices are connected to the same network.

Next, open the terminal and run the following command to generate a QR code:

qrcp receive
Generating-file-receiving-QR-code

Head to your mobile device and scan this QR code. When the link opens, it'll present you with qrcp's file sharing web app. Here, tap on the Choose Files button and use the file browser to select files (or folders) you want to share.

Hit Transfer to send the files/folders across. By default, qrcp saves the received files to your system's desktop. However, you can change the save location by specifying your preferred directory when generating the QR code.

To do this, in the terminal window, use the following command:

qrcp receive --output=/preferred/destination/directory

For example:

qrcp receive --output=/home/Documents

Although qrcp works well with the default configuration settings, there are times when you might want to change values for options like port, network interface, or URL scheme to suit your requirements. In such instances, you can head over to qrcp's GitHub page to refer to their configuration guide.

Successfully Transferring Files Using qrcp

If you're someone who prefers to work via the terminal, qrcp is the perfect tool in your arsenal for all your file transferring needs. Using it, you'll be able to transfer files in no time. That too, without leaving the terminal or having to download any app on your devices.

This qrcp guide should have you covered in pretty much all essential fronts. However, if you'd like to explore more of its functionalities, like transferring files over HTTPS, you can check out their GitHub page.

In case interacting with a terminal isn't something you're comfortable with, you can check out Snapdrop, a web-based file transfer service.

admin

How Does the iPhone 13 Reflect Apple’s Environmental Impacts?

Previous article

The 6 Best Firefox Extensions for PDFs

Next article

You may also like

Comments

Leave a reply

Your email address will not be published. Required fields are marked *

More in LINUX

Login/Sign up