Open In App

banner command in Linux with examples

Last Updated : 12 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The ‘banner’ command in Linux is a simple yet powerful utility used to display text in large ASCII characters on the terminal. This command can be particularly useful for creating prominent messages or headings within scripts and outputs.

Syntax of the ‘banner’ Command

banner text

banner ‘Command’ Examples in Linux

Let us take a look at some of the examples of the ‘banner’ Command in Linux to better understand the concept.

Example 1: Printing “1234567890” in large letters. 

This command prints the numbers 1234567890 in large characters on the terminal.

Example 2: Printing “GeeksforGeeks” in large ASCII Characters

There are two things:  

  • First, all the letter will be displayed in Capital letters in standard output.
  • Second, only “GEEKSFORGE” will be printed as banner has a default capacity of 10 characters in a word. After that, you have to give space which is shown in further examples.

Example 3: Printing “Geeks for Geeks” on display. 

Each word is displayed up to the 10-character limit, with spaces allowed between words.

Example 4: Attempting to Print “1234567890123”

Trying to print 1234567890123 in a single word but only 1234567890 will be printed on display. 

Only the first 10 characters (1234567890) will be displayed, due to the command’s character limit.

Displaying Help Information

To access the help information and additional options for the banner command, use:

info banner 

or

man banner 

It displays help information. 

Note: If the terminal shows banner not found, then in UBUNTU use ‘sudo apt install sysvbanner‘ or ‘sudo apt install banner‘ to download it. 

Alternatives and Limitations:

While the ‘banner‘ command is simple and effective, it lacks advanced customization options like different fonts or colors. If you require more complex ASCII art, consider using tools like ‘figlet’ or ‘toilet’, which provide greater flexibility and styling options.

Conclusion

The ‘banner’ command in Linux offers a quick way to print large ASCII text to the terminal, with usage and limited configuration. It’s perfect for creating simple, eye-catching messages in scripts or terminal sessions. Remember its limitations on character count and uppercase formatting when planning your use cases.


Next Article

Similar Reads