qrcp:扫描QR码以通过Wi-Fi在台式机和移动设备之间传输文件
qrcp 是一种命令行工具,可扫描QR码并将文件从桌面通过Wi-Fi传输到移动设备(反之亦然)。在Microsoft Windows,macOS,Linux上可用。
该应用程序将Web服务器绑定到随机端口Wi-Fi网络接口的地址(如果需要,您可以指定端口)。扫描QR码后,下载将开始(或者您可以在Web浏览器中打开QR应用扫描的URL并开始下载)。传输完成后,Web服务器将自动关闭。将文件从移动设备传输到桌面时,qrcp提供了一个网页,可用于选择要传输的文件。
当您将文件从台式机传输到移动设备时,URL都会显示在终端上,反之亦然。因此,您可以输入URL而不需要扫描QR码。 ? qrcp也支持这一点。在这种情况下,它将自动创建要传输的文件或文件夹的zip存档,并在传输完成后删除zip存档。
要通过Wi-Fi将文件从桌面发送到移动设备,请以文件为参数运行qrcp,如以下示例所示:
qrcp Image.jpg
以相同的方式发送文件夹。 qrcp /path/to/folder
..
使用(示例)发送多个文件。
qrcp Image1.jpg Image2.jpg Image3.jpg
要通过Wi-Fi将文件从移动设备接收到桌面,请使用以下命令:
qrcp receive
或者,要接收特定目录中的文件:
qrcp receive --output=/path/to/directory
运行时 receive
扫描命令(移动设备上的QR码)打开一个网页,您可以在其中选择移动设备上的文件,然后将文件传输到运行qrcp的桌面上。
如果您有多个网络接口,则首次运行qrcp时,系统将提示您选择用于文件传输的网络接口(通常需要选择enp3s0或eth0格式)。 ..
您也可以选择 any (0.0.0.0)
作为网络接口。在这种情况下,该文件将可用于同一网络上的所有用户以及外部网络(除非端口被防火墙或路由器阻止)。
应用程序配置被隐藏并保存 .qrcp.json
用户主目录中的文件。
可用的qrcp选项包括:
$ qrcp --help
Usage:
qrcp [flags]
qrcp [command]
Available Commands:
config Configure qrcp
help Help about any command
receive Receive one or more files
send Send a file(s) or directories from this host
version Print version number and build information.
Flags:
-c, --config string path to the config file, defaults to $HOME/.qrcp
-d, --fqdn string fully-qualified domain name to use for the resulting URLs
-h, --help help for qrcp
-i, --interface string network interface to use for the server
-k, --keep-alive keep server alive after transferring
-l, --list-all-interfaces list all available interfaces when choosing the one to use
--path string path to use. Defaults to a random string
-p, --port int port to use for the server
-q, --quiet only print errors
-z, --zip zip content before transferring
Use "qrcp [command] --help" for more information about a command.
下载qrcp
在Microsoft Windows,macOS和Linux上都可以使用qrcp。
在Linux上, 包装好的 DEB(用于Debian,Ubuntu和其他基于它们的Linux发行版,例如Linux Mint,Pop!_OS,Zorin OS,Elementary OS),RPM(用于Fedora,openSUSE,CentOS等)。还有一个通用的Linux二进制文件可与任何Linux发行版一起使用。适用于Arch Linux和Manjaro用户的Arch Linux中可用。
H T: 区域