Crafting Striking Terminal Text with FIGlet

LinuxLinuxBeginner
Practice Now

Introduction

FIGlet is a utility for creating large characters out of ordinary screen characters. It's often used in terminal sessions to create eye-catching text, banners, or headers. This project will guide you through the process of using it to generate text, and customizing your output with different fonts.

figlet

Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/PackagesandSoftwaresGroup(["`Packages and Softwares`"]) linux/PackagesandSoftwaresGroup -.-> linux/software("`Linux Software`") subgraph Lab Skills linux/software -.-> lab-272383{{"`Crafting Striking Terminal Text with FIGlet`"}} end

Create Large Letters

To use figlet, open the terminal ( ① or ② in the figure ) in the environment and simply type figlet followed by the text you want to display::

figlet Hello World

This command display "Hello World" in large letters.

figlet

Changing Fonts

To use a specific font, use the -f option followed by the font name:

figlet -f slant Hello World

output:

    __  __     ____         _       __           __    __
   / / / /__  / / /___     | |     / /___  _____/ /___/ /
  / /_/ / _ \/ / / __ \    | | /| / / __ \/ ___/ / __  /
 / __  /  __/ / / /_/ /    | |/ |/ / /_/ / /  / / /_/ /
/_/ /_/\___/_/_/\____/     |__/|__/\____/_/  /_/\__,_/

figlet comes with a variety of fonts. To list all available fonts:

showfigfonts

output:

banner :

######    ###   ##    ## ##    ## ####### ###### ##    ##  ##  ##  ###   ## ###   ## ##      ##    ## ######  ##    ## ## ##  ## ## ##  ## ######  ##    ## ##    ## ####### ##  ## ## ##  ## ## ##      ###### ##    ## ##    ## ##   ### ##   ### ##      ##   ## ######  ##    ## ##    ## ##    ## ####### ##    ## 


big :
 _     _
| |   (_)
| |__  _  __ _
| '_ \| |/ _` |
| |_) | | (_| |
|_.__/|_|\__, |
          __/ |
         |___/


block :

_|        _|                      _|
_|_|_|    _|    _|_|      _|_|_|  _|  _|
_|    _|  _|  _|    _|  _|        _|_|
_|    _|  _|  _|    _|  _|        _|  _|
_|_|_|    _|    _|_|      _|_|_|  _|    _|

...

Adjusting Width

To make figlet fit the text into a specific width, use the -w option:

figlet -w 80 Hello World

This command will ensure the output fits within 80 columns.

output:

 _   _      _ _        __        __         _     _
| | | | ___| | | ___   \ \      / /__  _ __| | __| |
| |_| |/ _ \ | |/ _ \   \ \ /\ / / _ \| '__| |/ _` |
|  _  |  __/ | | (_) |   \ V  V / (_) | |  | | (_| |
|_| |_|\___|_|_|\___/     \_/\_/ \___/|_|  |_|\__,_|

Centering Text

To center the figlet output in your terminal, use the -c option:

figlet -c Hello World

output:

               _   _      _ _        __        __         _     _
              | | | | ___| | | ___   \ \      / /__  _ __| | __| |
              | |_| |/ _ \ | |/ _ \   \ \ /\ / / _ \| '__| |/ _` |
              |  _  |  __/ | | (_) |   \ V  V / (_) | |  | | (_| |
              |_| |_|\___|_|_|\___/     \_/\_/ \___/|_|  |_|\__,_|

Using figlet for Terminal Banners

You can add figlet commands to your .bashrc or .zshrc file to display a banner each time you open a terminal:

echo "figlet -f slant 'Welcome to Labex!'" >> ~/.bashrc

Summary

FIGlet is a fun and simple way to add large text banners to your terminal sessions. Whether you're spicing up your script outputs, creating headers for your terminal-based presentations, or just having fun with terminal customization, FIGlet provides an easy-to-use interface for big, bold text. Experiment with different fonts and options to find your favorite style.

Other Linux Tutorials you may like