TrumanWong

figlet

The string is converted into "characters and characters".

Supplementary instructions

Convert ordinary strings into "characters and characters" formed by concatenating simple characters.

Install

Ubuntu and other systems

apt-get update
apt-get install -y figlet

CentOS and other systems

yum install epel-release
yum install -y figlet

grammar

figlet [ message ] [ -option ]

Parameters

message is the string that needs to be converted. When no message is input, the standard input will be read, so it can be used with the pipe character, etc.

Options

-w limit output width, default is '80'
-c Center display
-f specifies the font, the default is 'standard'
-k preserve spaces between characters
-t aligns the width to the width of the current terminal. This parameter has a higher priority than -w.
-v displays version information

return value

A string is a "character and character" composed of simple characters.

Example

Input from parameters

figlet 'Hello, World!'
  _ _ _ _ __ __ _ _ _
| | | | ___| | | ___ \ \ / /__ _ __| | __| | |
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
|_| |_|\___|_|_|\___( ) \_/\_/ \___/|_| |_|\__,_(_)

Input with pipe character

echo 'Hello, World!' | figlet
  _ _ _ _ __ __ _ _ _
| | | | ___| | | ___ \ \ / /__ _ __| | __| | |
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
|_| |_|\___|_|_|\___( ) \_/\_/ \___/|_| |_|\__,_(_)

Limit width

figlet 'Hello, World!' -w 40
  _ _ _ _
| | | | ___| | | ___
| |_| |/ _ \ | |/ _ \
| _ | __/ | | (_) |
|_| |_|\___|_|_|\___( )
                     |/
__ __ _ _ _
\ \ / /__ _ __| | __| | |
  \ \ /\ / / _ \| '__| |/ _` | |
   \ V V / (_) | | | | (_| |_|
    \_/\_/ \___/|_| |_|\__,_(_)

Centered display

figlet 'Hello, World!' -w 40 -c
          _ _ _ _
         | | | | ___| | | ___
         | |_| |/ _ \ | |/ _ \
         | _ | __/ | | (_) |
         |_| |_|\___|_|_|\___( )
                             |/
     __ __ _ _ _
     \ \ / /__ _ __| | __| | |
      \ \ /\ / / _ \| '__| |/ _` | |
       \ V V / (_) | | | | (_| |_|
        \_/\_/ \___/|_| |_|\__,_(_)

###Specify font

figlet 'Hello, World!' -w 40 -c -f slant
             __ __ ____
            / / / /__ / / /___
           / /_/ / _ \/ / / __ \
          / __ / __/ / / /_/ /
         /_/ /_/\___/_/_/\____( )
                              |/
      _ __ __ ____
     | | / /___ _____/ /___/ / /
     | | /| / / __ \/ ___/ / __ / /
     | |/ |/ / /_/ / / / / /_/ /_/
     |__/|__/\____/_/ /_/\__,_(_)

Preserve spaces between characters

figlet 'Hello, World!' -w 40 -c -k
        _ _ _ _
       | | | | ___ | || | ___
       | |_| | / _ \| || | / _ \
       | _ || __/| || || (_) |_
       |_| |_| \___||_||_| \___/( )
                                |/
   __ __ _ _ _
   \ \ / /___ _ __ | | __| || |
    \ \ /\ / // _ \ | '__|| | / _` || |
     \ V V /| (_) || | | || (_| ||_|
      \_/\_/ \___/ |_| |_| \__,_|(_)