I use qrencode to generate Quick Response (QR) codes. While there are many web-based and GUI methods of generating these, I decided that I wanted an open source and command-line based method. qrencode is the easiest one to use that I’ve found – so far.
qrencode uses the libqrencode library to produce a QR Code symbol.
I followed How-To Geek’s instructions to install qrencode – steps are given for Fedora, Ubuntu and Manjaro, and also examples of how to run qrencode.
Installation is straightforward – on Fedora 36, it’s simply:
$ sudo dnf install qrencode
which pulls down the qrencode package and all required dependencies from the default Fedora software repositories.
Example running qrencode
$ qrencode -d 128 -o test.png "https://geekgirllinuxland.com"
This generates the following QR code image and saves it to output file test.png:
- The ‘-d’ specifies the resolution (in dpi or dots per inch) of the resulting output image.
- The ‘-o’ specifies the output file to write the resulting QR Code to.
- PNG is the default output image type anyway, so I didn’t need to specify the “.png” in the output file name above. If I wanted to change the filetype, I can do so by specifying a ‘-t’ or ‘–type’ followed by the file type I want.
You can check out all qrencode’s options either in its documentation found here, or using the Linux man pages by typing:
$ man qrencode
on the Linux command-line.
Linux Magazine has some more information on qrencode which you can find here.
SourceForge hosts a compiled executable of QREncode for Windows.
Albanese, P. F. (n.d.). QREncode for Windows. SourceForge. Retrieved September 8, 2022, from https://sourceforge.net/projects/qrencode-for-windows/
Die.net (n.d.). qrencode(1) – Linux man page. Die.net. Retrieved September 8, 2022, from https://linux.die.net/man/1/qrencode
Fukuchi, K. (n.d.). libqrencode. Kentaro Fukuchi Home Page. Retrieved September 8, 2022, from https://fukuchi.org/works/qrencode/
McKay, D. (2020, December 8). How to Create QR Codes From the Linux Command Line. How-To Geek. Retrieved September 8, 2022, from https://www.howtogeek.com/devops/how-to-create-qr-codes-from-the-linux-command-line/
Schürmann, T. (n.d.). Generating QR Codes in Linux. Linux Magazine. Retrieved September 8, 2022, from https://www.linux-magazine.com/Online/Features/Generating-QR-Codes-in-Linux