How to install Figlet on Amazon Linux 2 AWS

Create a stylized ASCII text banner on your command line screen by installing Figlet on Amazon Linux 2 with the help of the EPEL repository.

Figlet is a command-line utility that allows you to create ASCII text banners, also known as “FIGlets.” We can install it easily on Linux, macOS, and Windows to create text in ASCII art format. It was created by Glenn Chappell and Ian Chai in the late 1980s for creating eye-catching headers and titles for documents, presentations, and websites using smaller ASCII characters. It can be used further to create logos, ASCII art, and other visual elements, as well as to add emphasis and style to plain text.

It is free and open source and popular especially among programmers, web designers, and anyone else who wants to add some creativity to their text-based projects. To create complex text manipulations and transformations developers often use Figlet with other command-line tools, such as grep, sed, and awk.

Figlet is not just limited to a signal font, instead supports a wide range of fonts and output options, including horizontal and vertical layouts, smushing (overlapping characters to save space), and kerning (adjusting the spacing between characters). The output can be customized by choosing from various fonts and styles and can be saved to a file or displayed in the terminal.

In a few words, Figlet is a versatile and powerful tool for creating ASCII art and stylized text. It is widely used in the command-line interface and can be integrated into various programming languages and applications.

Steps to install FIGlets in Amazon Linux

The steps given here can also be used in the latest version of AWS Linux 2 to add Fliget and use it to create stylish text on the terminal.

Start with updating

Let’s first issue a command that is not necessary; however, it is good to make sure our system is up to date, right? Use YUM and run the update command.

sudo yum update -y

Install amazon-Linux-extras

We cannot enable the EPEL on Amazon Linux 2 using the YUM package manager by default unless a user is not manually adding the EPEL repository.

By default, the Amazon Linux 2 comes with a tool or repo called Amazon-Linux Extra that includes all the major Repos or packages we are required to add to our Linux system. This also includes EPEL.

sudo yum install amazon-linux-extras

Add EPEL Repository

Figlet is not available to install using the default system repository of Amazon Linux, for that we need to add third-party EPEL repo. On your command terminal, follow the given command:

sudo amazon-linux-extras install epel -y

Install Figlet on Aamzon Linux 2

Finally, on your command terminal use the system package manager and install Figlet on Amazon Linux 2 using the EPEL repository.

sudo yum install figlet
Install Figlet on Amazon Linux 2

How to use Figlet commands

Once you have Figlet installed, you can use it by opening a terminal and typing the following command:

figlet [text]

Replace [text] with the text you want to convert to ASCII art.

For example:

figlet Linuxshout
How to use figlet

This will create an ASCII art banner of the text “Linuxshout” using the default font. But we can customize the output further by using different fonts and options.

Here are some examples:

Use Fonts

To use some different fonts, we need to use  -f flag with the font name. You can have a list of all available fonts from the official page.

figlet -f slant LinuxShout

Change the output width

Now, if you want to adjust the width of your text then use the -w flag. The terminal will use 80-column width to display the text.

figlet -w 80 LinuxShout

To Add some space between the Text characters, we can use -k flag that enables kerning- printing each letter of the message individually, instead of merging into the adjacent letters.

figlet -k LinuxShout
Add space to Figlet characters

For Alignment:

To align output text in the centers of the Terminal use -c flag and in the same way for Left-alignment use -l and for right -r.

figlet text alignment

For creating a Vertical Text banner

In the below given example, we set the maximum width of the output to 1 using the -w option. This causes figlet to output each character of the message on a separate line. We then use the tr command to delete all spaces, which effectively transposes the output vertically.

figlet -w 1 "Linuxshout" | tr -d ' '

These were a few examples and commands that let you install and use the Figlet ASCII art tool on Amazon Linux 2 to create creative text banners on the terminal. You can also find more information and examples on the Figlet manpage.

Leave a Comment

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