mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-10 22:21:11 +08:00
translated
This commit is contained in:
parent
bea3f6fbef
commit
1064fa7e58
@ -1,135 +0,0 @@
|
||||
translating---geekpi
|
||||
|
||||
Transfer Files From Computer To Mobile Devices By Scanning QR Codes
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-720x340.png)
|
||||
Transferring files from a Computer to a smartphone is not a big deal. You can do this by mounting the mobile phone on your system using an USB cable, then transfer files from the file manager. Also, some third party applications, such as [**KDE Connect**][1] and [**AirDroid**][2], can help you to easily manage and transfer files from your system to Android devices. Today, I stumbled upon a super cool utility named **“Qr-filetransfer”**. It allows you to transfer files over WiFi from computer to mobile devices by scanning QR codes without leaving your Terminal. Yes, you read that right! The qr-filetransfer is a free, open source command line utility written using Go programming language. In this brief tutorial, we are going to learn to transfer files from Linux to any mobile devices using qr-transfer.
|
||||
|
||||
### Installing Qr-filetransfer
|
||||
|
||||
First, install Go language on your system.
|
||||
|
||||
On Arch Linux and derivatives:
|
||||
```
|
||||
$ sudo pacman -S go
|
||||
|
||||
```
|
||||
|
||||
On RPM based systems like RHEL, CentOS, Fedora, run:
|
||||
```
|
||||
$ sudo yum install golang
|
||||
|
||||
```
|
||||
|
||||
Or,
|
||||
```
|
||||
$ sudo dnf install golang
|
||||
|
||||
```
|
||||
|
||||
On DEB based systems such as Debian, Ubuntu, Linux Mint, you can install it using command:
|
||||
```
|
||||
$ sudo apt-get install golang
|
||||
|
||||
```
|
||||
|
||||
On SUSE/openSUSE:
|
||||
```
|
||||
$ sudo zypper install golang
|
||||
|
||||
```
|
||||
|
||||
After installing Go language, run the following command to download qr-filetransfer application.
|
||||
```
|
||||
$ go get github.com/claudiodangelis/qr-filetransfer
|
||||
|
||||
```
|
||||
|
||||
The above command will download the contents of a qr-filetrnasfer GitHub repository in a directory named **“go”** in your current working directory.
|
||||
|
||||
Copy the qt-filetransfer binary file to your PATH, for example /usr/local/bin/.
|
||||
```
|
||||
$ sudo cp go/bin/qr-filetransfer /usr/local/bin/
|
||||
|
||||
```
|
||||
|
||||
Finally, make it executable as shown below.
|
||||
```
|
||||
$ sudo chmod +x /usr/local/bin/qr-filetransfer
|
||||
|
||||
```
|
||||
|
||||
### Transfer Files From Computer To Mobile Devices By Scanning QR Codes
|
||||
|
||||
Make sure that your smartphone is connected to the same WiFi network as your computer.
|
||||
|
||||
Then, launch qt-filetransfer tool along the with the file or folder path you want to transfer to your smartphone.
|
||||
|
||||
For example, I am going to transfer a mp3 file.
|
||||
```
|
||||
$ qr-filetransfer Chill\ Study\ Beats.mp3
|
||||
|
||||
```
|
||||
|
||||
At first launch, qr-filetransfer will ask you to choose the network interface to use like below.
|
||||
```
|
||||
Choose the network interface to use (type the number):
|
||||
[0] enp5s0
|
||||
[1] wlp9s0
|
||||
|
||||
```
|
||||
|
||||
I was going to transfer file using **wlp9s0** interface, so I typed “1”. Qr-filetransfer will remember this choice and you will never be prompted again, unless you pass the **-force** argument, or delete the **.qr-filetransfer.json** file that the program stores in the home directory of current user.
|
||||
|
||||
Then, you will see the QR code as shown in the below picture.
|
||||
|
||||
![][4]
|
||||
|
||||
Open the QR code app (if it is not installed already, install any QR code reader app from play store) and scan the QR code displayed in your terminal.
|
||||
|
||||
Once the QR code is read, you will be asked whether you want to copy the link or open the link. You can either copy the link and paste it manually on your mobile web browser or choose “Open link” to automatically open it in your mobile browser.
|
||||
|
||||
![][5]
|
||||
|
||||
Once the share link has been opened, the file will be downloaded in your smartphone.
|
||||
|
||||
![][6]
|
||||
|
||||
If the file is too big, zip the file, then transfer it
|
||||
```
|
||||
$ qr-filetransfer -zip /path/to/file.txt
|
||||
|
||||
```
|
||||
|
||||
To transfer a full directory, run:
|
||||
```
|
||||
$ qr-filetransfer /path/to/directory
|
||||
|
||||
```
|
||||
|
||||
Please note that the directory gets zipped before being transferred.
|
||||
|
||||
Qr-filetransfer utility will only transfer the stuffs from your system to mobile and not vice versa. This project is very new, so there will be bugs. If you encountered any bugs, report them in the GitHub page given at the end of this guide.
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/transfer-files-from-computer-to-mobile-devices-by-scanning-qr-codes/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.ostechnix.com/author/sk/
|
||||
[1]:https://www.ostechnix.com/kde-connect-access-files-notifications-android-devices/
|
||||
[2]:https://www.ostechnix.com/airdroid-share-files-and-folders-between-linux-and-android/
|
||||
[4]:http://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-5.png
|
||||
[5]:http://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-6-4.png
|
||||
[6]:http://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-4.png
|
@ -0,0 +1,133 @@
|
||||
通过扫描二维码将文件从计算机传输到移动设备
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-720x340.png)
|
||||
将文件从计算机传输到智能手机并不是什么大问题。你可以使用 USB 线将手机挂载到系统上,然后从文件管理器传输文件。此外,某些第三方应用程序(例如 [**KDE Connect**][1] 和 [**AirDroid**] [2])可帮助你轻松管理和传输系统中的文件至 Android 设备。今天,我偶然发现了一个名为 **“Qr-filetransfer”** 的超酷工具。它允许你通过扫描二维码通过 WiFi 将文件从计算机传输到移动设备而无须离开终端。是的,你没有看错! qr-filetransfer 是一个使用 Go 语言编写的免费的开源命令行工具。在这个简短的教程中,我们将学习如何使用 qr-transfer 将文件从 Linux 传输到任何移动设备。
|
||||
|
||||
### 安装 Qr-filetransfer
|
||||
|
||||
首先,在你的系统上安装 Go 语言。
|
||||
|
||||
在 Arch Linux 及其衍生版上:
|
||||
```
|
||||
$ sudo pacman -S go
|
||||
|
||||
```
|
||||
|
||||
在基于 RPM 的系统(如 RHEL、CentOS、Fedora)上运行:
|
||||
```
|
||||
$ sudo yum install golang
|
||||
|
||||
```
|
||||
|
||||
或者:
|
||||
```
|
||||
$ sudo dnf install golang
|
||||
|
||||
```
|
||||
|
||||
在基于 DEB 的系统上,例如 Debian、Ubuntu、Linux Mint,你可以使用命令安装它:
|
||||
```
|
||||
$ sudo apt-get install golang
|
||||
|
||||
```
|
||||
|
||||
在 SUSE/openSUSE 上:
|
||||
```
|
||||
$ sudo zypper install golang
|
||||
|
||||
```
|
||||
|
||||
安装 Go 语言后,运行以下命令下载 qr-filetransfer 应用。
|
||||
```
|
||||
$ go get github.com/claudiodangelis/qr-filetransfer
|
||||
|
||||
```
|
||||
|
||||
上述命令将在当前工作目录下的一个名为 **“go”** 的目录中下载 qr-filetrnasfer GitHub 仓库的内容。
|
||||
|
||||
将 qt-filetransfer 的二进制文件复制到 PATH 中,例如 /usr/local/bin/。
|
||||
```
|
||||
$ sudo cp go/bin/qr-filetransfer /usr/local/bin/
|
||||
|
||||
```
|
||||
|
||||
最后,如下使其可执行:
|
||||
```
|
||||
$ sudo chmod +x /usr/local/bin/qr-filetransfer
|
||||
|
||||
```
|
||||
|
||||
### 通过扫描二维码将文件从计算机传输到移动设备
|
||||
|
||||
确保你的智能手机已连接到与计算机相同的 WiFi 网络。
|
||||
|
||||
然后,使用要传输的文件的完整路径启动 qt-filetransfer。
|
||||
|
||||
比如,我要传输一个 mp3 文件。
|
||||
```
|
||||
$ qr-filetransfer Chill\ Study\ Beats.mp3
|
||||
|
||||
```
|
||||
|
||||
首次启动时,qr-filetransfer 会要求你选择使用的网络接口,如下所示。
|
||||
```
|
||||
Choose the network interface to use (type the number):
|
||||
[0] enp5s0
|
||||
[1] wlp9s0
|
||||
|
||||
```
|
||||
|
||||
我打算使用 **wlp9s0** 接口传输文件,因此我输入 “1”。qr-filetransfer 会记住这个选择,除非你通过 **-force** 参数或删除程序存储在当前用户的家目录中的 **.qr-filetransfer.json** 文件,否则永远不会再提示你。
|
||||
|
||||
然后,你将看到二维码,如下图所示。
|
||||
|
||||
![][4]
|
||||
|
||||
打开二维码应用(如果它尚未安装,请从 Play 商店安装任何一个二维码读取程序)并扫描终端中显示的二维码。
|
||||
|
||||
读取二维码后,系统会询问你是要复制链接还是打开链接。你可以复制链接并手动将其粘贴到移动网络浏览器上,或者选择“打开链接”以在移动浏览器中自动打开它。
|
||||
|
||||
![][5]
|
||||
|
||||
共享链接打开后,该文件将下载到智能手机中。
|
||||
|
||||
![][6]
|
||||
|
||||
如果文件太大,请压缩文件,然后传输它
|
||||
```
|
||||
$ qr-filetransfer -zip /path/to/file.txt
|
||||
|
||||
```
|
||||
|
||||
要传输整个目录,请运行:
|
||||
```
|
||||
$ qr-filetransfer /path/to/directory
|
||||
|
||||
```
|
||||
|
||||
请注意,目录在传输之前会被压缩。
|
||||
|
||||
qr-filetransfer 只能将系统中的内容传输到移动设备,反之不能。这个项目非常新,所以会有 bug。如果你遇到了任何 bug,请在本指南最后给出的 GitHub 页面上报告。
|
||||
|
||||
干杯!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/transfer-files-from-computer-to-mobile-devices-by-scanning-qr-codes/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.ostechnix.com/author/sk/
|
||||
[1]:https://www.ostechnix.com/kde-connect-access-files-notifications-android-devices/
|
||||
[2]:https://www.ostechnix.com/airdroid-share-files-and-folders-between-linux-and-android/
|
||||
[4]:http://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-5.png
|
||||
[5]:http://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-6-4.png
|
||||
[6]:http://www.ostechnix.com/wp-content/uploads/2018/03/qr-filetransfer-4.png
|
Loading…
Reference in New Issue
Block a user