The Wayback Machine - https://web.archive.org/web/20241228134502/https://www.geeksforgeeks.org/banner-command-in-linux-with-examples/
Open In App

banner command in Linux with examples

Last Updated : 12 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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.

banner command in Linux – FAQs

What is the banner command in Linux?

The ‘banner’ command in Linux is used to print text in large ASCII characters on the terminal. It’s a simple utility that can be used for creating prominent headings or messages in terminal outputs or scripts.

How do I use the banner command?

To use the ‘banner’ command, type banner followed by the text you want to display. For example:

banner HelloWorld

This command will print “HELLOWORLD” in large ASCII characters.

What is the character limit of the ‘banner’ command?

The ‘banner‘ command has a default character limit of 10 characters for each word or input. If your text exceeds 10 characters, only the first 10 characters will be displayed.

Why is my text displayed in uppercase with the banner command?

The ‘banner’ command automatically converts all input text to uppercase characters. There is no option to display lowercase letters.


Next Article

Similar Reads

three90RightbarBannerImg