How do you output a QR code to the linux cli terminal for scanning?

Use the terminal application 'qrencode'. The command you are looking for is the following:

qrencode -t ansiutf8 < myfile_here

The t option is to specify output type. it can also be PNG for a file or ASCII as ascii format.

Passing an url inline:

qrencode -m 2 -t utf8 <<< ""

To ease the use, with an alias:

alias qr='qrencode -m 2 -t utf8 <<< "$1"'

The first time:


Now, later on, possible usages:


qr "Hello world!"

qr $(cat file.txt)