How do I print 'block' letters in the terminal?
Solution 1
This is part of the output of the linuxlogo
command, specifically part of the output of
linuxlogo -L gnu_linuxwhich in full looks like this screenshot from the Debian version:
The logos are constructed from templates that accompany the command. This is the one for the gnu_linux
logo. There are 30 logos in the original package. Debian adds a debian_banner_2
logo.
From reading these logo files, right there in the source trees, one can see how the several different forms of lettering in the various logos are constructed with ECMA-48 and ISO 8613-6 control sequences, and one can derive further logos of one's own.
Solution 2
You can always use banner
and convert the #
to █
or to a space in reverse video.
On Debian-based systems, you'll find the SysV style banner
in the sysvbanner
package and the BSD-style one (called printerbanner
there) in the bsdmainutils
package. Or use figlet -f banner
:
$ figlet -f banner test | sed $'s/#/█/g'
█████ ██████ ████ █████
█ █ █ █
█ █████ ████ █
█ █ █ █
█ █ █ █ █
█ ██████ ████ █
$ printerbanner -w 40 test | sed 's/#/█/g'
█
█████████████████
████████████████████
████████████████████
██ █
██
█
█████
███████████
██████████████
██ █ ██
█ █ █
█ █ █
█ █ ██
█ ████████
██ ██████
███
████ ██
████ ██████
██ ████████
█ ████ █
█ ████ █
█ ████ ██
█ ████ ██
████████ ████
█████
█
█████████████████
████████████████████
████████████████████
██ █
██
█
$ banner test | sed 's/#/█/g'
█████ ██████ ████ █████
█ █ █ █
█ █████ ████ █
█ █ █ █
█ █ █ █ █
█ ██████ ████ █
For the inverse video space:
banner text | sed $'s/#/\e[7m \e[m/g'
($'...'
is a form of quote available in most modern shells like zsh
, ksh93
, bash
, mksh
or FreeBSD sh
. If your shell lacks support for it use "$(printf 's/#/\33[7m \33[m/g')"
instead).