Posted on
Software

figlet: ASCII text generator

Author
  • User
    Linux Bash
    Posts by this author
    Posts by this author

Transform Your Text: Mastering Figlet in the Linux Terminal

Do you want to add some creative flair to your text in the terminal or simply impress your colleagues? Welcome to the world of figlet, a fun and simple ASCII text generator that can instantly transform plain text into impressive art designs using standard characters. In this blog, we'll explore how you can install and use figlet on various Linux distributions and some tips and tricks to make the most out of it.

What is Figlet?

Figlet stands for "Frank, Ian, and Glenn's Letters". Originally created in 1991, it's designed to create large characters out of ordinary text. It's widely used in shell scripts, login prompts, and even for network banners to add a unique touch of aesthetic and humor.

Installing Figlet

The installation process of figlet varies slightly depending on your Linux distribution. Below are the installation instructions for some of the most popular Linux package management systems: apt, dnf, and zypper.

Debian/Ubuntu (Using apt)

For those using Debian-based distributions like Ubuntu, figlet can be installed easily using apt. First, make sure your package list is updated:

sudo apt update

Then, install figlet:

sudo apt install figlet

Fedora (Using dnf)

If you are using Fedora or other distributions that utilize dnf as their package manager, you can install figlet with the following commands:

sudo dnf update
sudo dnf install figlet

openSUSE (Using zypper)

For users of openSUSE or SUSE Linux Enterprise, zypper is the tool of choice. To install figlet:

sudo zypper refresh
sudo zypper install figlet

How to Use Figlet

Once figlet is installed, using it is incredibly simple. To transform text into an ASCII art banner, just type figlet followed by the text you want in quotes. For example:

figlet "Hello World"

This command would output the text "Hello World" in large ASCII characters.

Advanced Usage

Figlet comes with several options and a variety of fonts, which can be used to customise the output. Here are a few useful options:

Change Font

Figlet has several fonts available, and you can specify which font to use with the -f option. To list all available fonts:

figlet -f ➊ cursive

To use a specific font:

figlet -f big "Hello World"

Centralizing and Formatting

You can also align the output text to the center or right of your terminal using the -c (center) and -r (right) options respectively. For example, to center-align:

figlet -c "Centered Text"

Tips and Tricks

  • Create a startup banner: You can add figlet commands to your .bashrc or .zprofile file to display a custom banner each time you open a terminal.

  • Scripts and Alerts: Use figlet in scripts to highlight important messages or alerts.

  • Combine with lolcat for Color: For an extra layer of fun, pipe the output of figlet to lolcat to get colorful text banners:

figlet "Colorful" | lolcat

Conclusion

Figlet is a charming tool that can breathe new life into the monotony of text-only environments. Whether you're sprucing up your scripts, adding banners to your terminal sessions, or just having some fun, figlet offers a simple yet powerful way to do so. Give it a try and explore its potential to make your terminal more visually exciting and personalized.

Happy text crafting in the Linux Terminal!