X
    Categories: Linux

Awesome way to Create fancy linux banners using figlet

Many times we write a shell script for performing any task. Want to show the status messages with fancy way within your shell script output status messages. Then you must create fancy linux banners using figlet.

Installation for fancy linux banners using figlet:

  • You can download the rpm using on this link
  • Once downloaded install it using rpm command as below:
[root@rhel1]# 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%]
[root@rhel1]#

Now let’s begin with creating fancy banners using figlet

1.  Sample output:

[root@rhel1 ~]# figlet Hello UxTechno!
 _   _      _ _         _   _      _____         _                 _
| | | | ___| | | ___   | | | |_  _|_   _|__  ___| |__  _ __   ___ | |
| |_| |/ _ \ | |/ _ \  | | | \ \/ / | |/ _ \/ __| '_ \| '_ \ / _ \| |
|  _  |  __/ | | (_) | | |_| |>  <  | |  __/ (__| | | | | | | (_) |_|
|_| |_|\___|_|_|\___/   \___//_/\_\ |_|\___|\___|_| |_|_| |_|\___/(_)

[root@rhel1 ~]#

ScreenShot:

2. You can also use echo command for printing out the message on the screen.

[root@rhel1 ~]# echo 'Hello UxTechno!' | figlet
 _   _      _ _         _   _      _____         _                 _
| | | | ___| | | ___   | | | |_  _|_   _|__  ___| |__  _ __   ___ | |
| |_| |/ _ \ | |/ _ \  | | | \ \/ / | |/ _ \/ __| '_ \| '_ \ / _ \| |
|  _  |  __/ | | (_) | | |_| |>  <  | |  __/ (__| | | | | | | (_) |_|
|_| |_|\___|_|_|\___/   \___//_/\_\ |_|\___|\___|_| |_|_| |_|\___/(_)

[root@rhel1 ~]#

Different fonts for fancy linux banners using figlet

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

[root@rhel1 ~]# 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
[root@rhel1 ~]

Lets use the different fonts.

a. Bubble Font

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

b.  Big font

[root@rhel1 ~]# figlet -f big Hello UxTechno
 _    _      _ _         _    _   _______        _
| |  | |    | | |       | |  | | |__   __|      | |
| |__| | ___| | | ___   | |  | |_  _| | ___  ___| |__  _ __   ___
|  __  |/ _ \ | |/ _ \  | |  | \ \/ / |/ _ \/ __| '_ \| '_ \ / _ \
| |  | |  __/ | | (_) | | |__| |>  <| |  __/ (__| | | | | | | (_) |
|_|  |_|\___|_|_|\___/   \____//_/\_\_|\___|\___|_| |_|_| |_|\___/


[root@rhel1 ~]#

c. Script font

[root@rhel1 ~]# figlet -f script Hello UxTechno
 ,          _   _          _             ______        _
/|   |     | | | |        (_|    |      (_) |         | |
 |___|  _  | | | |  __      |    |          | _   __  | |     _  _    __
 |   |\|/  |/  |/  /  \_    |    |  /\/   _ ||/  /    |/ \   / |/ |  /  \_
 |   |/|__/|__/|__/\__/      \__/\_/ /\_/(_/ |__/\___/|   |_/  |  |_/\__/


[root@rhel1 ~]#

d. Digital Font

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

Aligning the fonts

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

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

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

[root@rhel1 ~]# figlet 'Hello UxTechno' -f slant -c
         __  __     ____         __  __    ______          __
        / / / /__  / / /___     / / / /  _/_  __/__  _____/ /_  ____  ____
       / /_/ / _ \/ / / __ \   / / / / |/_// / / _ \/ ___/ __ \/ __ \/ __ \
      / __  /  __/ / / /_/ /  / /_/ />  < / / /  __/ /__/ / / / / / / /_/ /
     /_/ /_/\___/_/_/\____/   \____/_/|_|/_/  \___/\___/_/ /_/_/ /_/\____/

[root@rhel1 ~]#

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

For Left alignment

[root@rhel1 ~]# figlet 'Hello UxTechno' -f slant -l
    __  __     ____         __  __    ______          __
   / / / /__  / / /___     / / / /  _/_  __/__  _____/ /_  ____  ____
  / /_/ / _ \/ / / __ \   / / / / |/_// / / _ \/ ___/ __ \/ __ \/ __ \
 / __  /  __/ / / /_/ /  / /_/ />  < / / /  __/ /__/ / / / / / / /_/ /
/_/ /_/\___/_/_/\____/   \____/_/|_|/_/  \___/\___/_/ /_/_/ /_/\____/

For right alignment

[root@rhel1 ~]# figlet 'Hello UxTechno' -f slant -r
             __  __     ____         __  __    ______          __
            / / / /__  / / /___     / / / /  _/_  __/__  _____/ /_  ____  ____
           / /_/ / _ \/ / / __ \   / / / / |/_// / / _ \/ ___/ __ \/ __ \/ __ \
          / __  /  __/ / / /_/ /  / /_/ />  < / / /  __/ /__/ / / / / / / /_/ /
         /_/ /_/\___/_/_/\____/   \____/_/|_|/_/  \___/\___/_/ /_/_/ /_/\____/

Related Post