QR Codes at the command line

QR Codes at the command line

QR code generation at the Linux command line

Now it is time to learn to QR Codes from the Linux terminal! QR codes are nothing new, but have you ever thought about creating your own from the command line? Someone had that idea before me and created the code to make it happen. The nice thing about making your own QR codes is that the information stays just on your computer, unlike using a website to do the work for you and not knowing who is collecting it.

Installing the code

“qrencode” is a versatile, fast, and richly-featured QR code generator that is executed at the command line.

To install qrencode on Ubuntu, we type this:

To install qrencode on Fedora, use this command:

Using qrencode

As with all commands in Linux – read the man page. There are a lot of options and tricks that you will pick up when you read the instructions.

Here are a couple of examples to QR Codes from the Linux terminal:

 

Making a QR code with your website address

This will produce a QR code png with your website address ready to be scanned.

QR Code for your “Guest” Wi-Fi

It’s possible to encode the details of a Wi-Fi network in a QR code. Visitors can scan the QR code to easily connect to your guest Wi-Fi.

The keyword is Wi-Fi, followed by a colon ” : ” and several other parameters.

  • T: The type of security. This can be WPA2 or WPA3. Note there is a colon between the “T” and the security value, and there is a semicolon ” ; ” after the security setting.
  • S: The Service Set ID (SSID) of the Wi-Fi network. Note there is a colon between the “S” and the SSID, and there is a semicolon ” ; ” after the SSID.
  • P: The password or security key of the Wi-Fi network. Note there is a colon between the “P” and the security key, and are two semicolons ” ;; ” after the security key.

QR Code contact

Make a QR code from the Linux command line for your contact details in the vCard format. It can be added to a QR code and scanned into the user’s address book. This removes the risk of mistyping something. There’s a lot of information that can be stored, so it is best to add the details to a file and to redirect that file into qrencode.

This text was added to a file called “contact_info.txt” – here is the text file:

 

We can redirect this file into qrencode like this:

Conclusion

I love using the command line for most things (I am a control freak and I admit it). Having the ability to make my own QR codes for things is handy for a lot of things. A couple examples of what I did are: First, I made a framed QR code for people I have over because I am always asked “what is the password to your Wi-Fi”. I can just point to the picture, and they can get onto my guest network.  Second, I created a business card with my VCard information in it, so people can scan it and add me to their address book.

Your imagination is the only thing holding you back. Try things with the code and create your own QR codes for things. Now you can do it right from the terminal!

For other fun things to do in the terminal – take a look at the Linux One-Liners – like making a thumbnail from a PDF

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 2

No votes so far! Be the first to rate this post.


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Updated on December 26, 2024

Pixelated Dwarf