One way to create fancy banners in Linux with figlet

We often write scripts for a variety of tasks. But we want to show status messages in some weird way in our shell script. Then you have to create Linux banners with figlet.

Installing Linux banners with figlet:

  • You can download with rpm at this link
  • Once downloaded, install it using the rpm command as shown below:
[[email protected]]# rpm -ivh figlet-2.2.2-1.el6.rf.x86_64.rpm
warning: figlet-2.2.2-1.el6.rf.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing... ########################################### [100%]
1:figlet ########################################### [100%]
[[email protected]]#

Now let’s start by creating fantasy banners using figlet

Output 1. Example:

[[email protected] ~]# figlet Hello UxTechno!
_   _      _ _         _   _      _____         _                 _
| | | | ___| | | ___   | | | |_  _|_   _|__  ___| |__  _ __   ___ | |
| |_| |/ _  | |/ _   | | |  / / | |/ _ / __| '_ | '_  / _ | |
|  _  |  __/ | | (_) | | |_| |>  <  | |  __/ (__| | | | | | | (_) |_|
|_| |_|___|_|_|___/   ___//_/_ |_|___|___|_| |_|_| |_|___/(_)
 
[[email protected] ~]#

2. You can also use the echo command to print the message to the screen.

[[email protected] ~]# echo 'Hello UxTechno!' | figlet
_   _      _ _         _   _      _____         _                 _
| | | | ___| | | ___   | | | |_  _|_   _|__  ___| |__  _ __   ___ | |
| |_| |/ _  | |/ _   | | |  / / | |/ _ / __| '_ | '_  / _ | |
|  _  |  __/ | | (_) | | |_| |>  <  | |  __/ (__| | | | | | | (_) |_|
|_| |_|___|_|_|___/   ___//_/_ |_|___|___|_| |_|_| |_|___/(_)
 
[[email protected] ~]#

Various fonts for fantasy banners in Linux with figlet

There are many other fonts available under figlet, you can use any of them to create fancy banners.

[[email protected] ~]# ls -ltr /usr/share/figlet|grep -i flf
-rw-r--r-- 1 root root 9697 Nov 11 2010 term.flf
-rw-r--r-- 1 root root 28335 Nov 11 2010 standard.flf
-rw-r--r-- 1 root root 12226 Nov 11 2010 smslant.flf
-rw-r--r-- 1 root root 10832 Nov 11 2010 smshadow.flf
-rw-r--r-- 1 root root 11274 Nov 11 2010 smscript.flf
-rw-r--r-- 1 root root 12235 Nov 11 2010 small.flf
-rw-r--r-- 1 root root 15520 Nov 11 2010 slant.flf
-rw-r--r-- 1 root root 13365 Nov 11 2010 shadow.flf
-rw-r--r-- 1 root root 15371 Nov 11 2010 script.flf
-rw-r--r-- 1 root root 83167 Nov 11 2010 mnemonic.flf
-rw-r--r-- 1 root root 9102 Nov 11 2010 mini.flf
-rw-r--r-- 1 root root 28596 Nov 11 2010 lean.flf
-rw-r--r-- 1 root root 10999 Nov 11 2010 ivrit.flf
-rw-r--r-- 1 root root 15139 Nov 11 2010 digital.flf
-rw-r--r-- 1 root root 19926 Nov 11 2010 bubble.flf
-rw-r--r-- 1 root root 24438 Nov 11 2010 block.flf
-rw-r--r-- 1 root root 26384 Nov 11 2010 big.flf
-rw-r--r-- 1 root root 31897 Nov 11 2010 banner.flf
[[email protected] ~]

Allows the use of various fonts.

and. Bubble font

[[email protected] ~]# figlet -f bubble Hello UxTechno
  _   _   _   _   _     _   _   _   _   _   _   _   _
/  /  /  /  /    /  /  /  /  /  /  /  / 
( H | e | l | l | o ) ( U | x | T | e | c | h | n | o )
_/ _/ _/ _/ _/   _/ _/ _/ _/ _/ _/ _/ _/
[[email protected] ~]#

b. Large font

[[email protected] ~]# figlet -f big Hello UxTechno
_    _      _ _         _    _   _______        _
| |  | |    | | |       | |  | | |__   __|      | |
| |__| | ___| | | ___   | |  | |_  _| | ___  ___| |__  _ __   ___
|  __  |/ _  | |/ _   | |  |  / / |/ _ / __| '_ | '_  / _ 
| |  | |  __/ | | (_) | | |__| |>  <| |  __/ (__| | | | | | | (_) |
|_|  |_|___|_|_|___/   ____//_/__|___|___|_| |_|_| |_|___/
 
 
[[email protected] ~]#

from. Script font

[[email protected] ~]# figlet -f script Hello UxTechno
,          _   _          _             ______        _
/|   |     | | | |        (_|    |      (_) |         | |
|___|  _  | | | |  __      |    |          | _   __  | |     _  _    __
|   |"https://andreyex.ru/"/  |/  /  _    |    |  //   _ ||/  /    |/    / "https://andreyex.ru/"  /  _
|   "https://andreyex.ru/"__/|__/|__/__/      __/_/ /_/(_/ |__/___/|   |_/  |  |_/__/
 
 
[[email protected] ~]#

e. digital font

[[email protected] ~]# figlet -f digital  Hello UxTechno
+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
|H|e|l|l|o| |U|x|T|e|c|h|n|o|
+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
[[email protected] ~]#

Aligning fonts

You can also align fonts left-right or center using the option below:

	
-l  Left-align
-c Center
-r  Right-align

Let’s say you want to center-align the text, then,

[[email protected] ~]# figlet 'Hello UxTechno' -f slant -c
         __  __     ____         __  __    ______          __
        / / / /__  / / /___     / / / /  _/_  __/__  _____/ /_  ____  ____
       / /_/ / _ / / / __    / / / / |/_// / / _ / ___/ __ / __ / __ 
      / __  /  __/ / / /_/ /  / /_/ />  < / / /  __/ /__/ / / / / / / /_/ /
     /_/ /_/___/_/_/____/   ____/_/|_|/_/  ___/___/_/ /_/_/ /_/____/
 
[[email protected] ~]#

Here we have specified the option -c at the end for center alignment.

For left alignment

	
[[email protected] ~]# figlet 'Hello UxTechno' -f slant -l
    __  __     ____         __  __    ______          __
   / / / /__  / / /___     / / / /  _/_  __/__  _____/ /_  ____  ____
  / /_/ / _ / / / __    / / / / |/_// / / _ / ___/ __ / __ / __ 
/ __  /  __/ / / /_/ /  / /_/ />  < / / /  __/ /__/ / / / / / / /_/ /
/_/ /_/___/_/_/____/   ____/_/|_|/_/  ___/___/_/ /_/_/ /_/____/

For proper alignment

	
[[email protected] ~]# figlet 'Hello UxTechno' -f slant -r
             __  __     ____         __  __    ______          __
            / / / /__  / / /___     / / / /  _/_  __/__  _____/ /_  ____  ____
           / /_/ / _ / / / __    / / / / |/_// / / _ / ___/ __ / __ / __ 
          / __  /  __/ / / /_/ /  / /_/ />  < / / /  __/ /__/ / / / / / / /_/ /
         /_/ /_/___/_/_/____/   ____/_/|_|/_/  ___/___/_/ /_/_/ /_/____/

Sidebar