The Wayback Machine - https://web.archive.org/web/20250220030737/https://www.geeksforgeeks.org/cool-custom-welcome-messages-linux-terminal/
Open In App

Cool Custom Welcome Messages on Linux terminal

Last Updated : 06 Nov, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

You can add your favorite welcome message to your command-line interface, and it can be the needed fun and personality added to your command line, but only if you know how to do so. This article guides you through methods to create custom welcome messages from plain text to more extensive displays with ASCII art using tools like Fortune and Cowsay.

Using .bashrc for Custom Messages

This is the .bashrc file script for Bash that this runs every time it enters into interactive mode. We could use this file to print some messages every time it launches a new terminal.

Syntax

echo "Your custom message here"

Steps on how to do it

1. Open your terminal and edit the .bashrc file:

nvim ~/.bashrc

2. Append the following line at the top of the file:

echo "Welcome Ramkumar"

3. Save the file and exit the editor

4. Quit the terminal and open a new one to search for your custom message

2024-10-24_12-43

edit .bashrc

2024-10-24_12-44

Terminal window displaying the custom welcome message ‘Welcome Ramkumar’

Using fortune and cowsay

Much more exciting and interactive welcome messages can be generated by using the fortune and cowsay command in tandem.

Installation

You could install fortune and cowsay for ubuntu or Linux Mint by using the following command:

sudo apt-get install fortune cowsay

Basic Usage

Add to your .bashrc file the following line

fortune | cowsay -pn

2024-10-24_12-50

edit .bashrc

2024-10-24_12-51

Terminal window showing a cow ASCII art with a fortune message in a speech bubble

Customizing cowsay

There are other options by which you can customize the output by cowsay. It supports different characters and formatting options.

Common Options

Option

Description

-f [character]

Use a character given as an argument, e.g., tux, stegosaurus

-e [eyes]

Change the eyes of the cow

-T [tongue]

Change the tongue of the cow

-W [column]

Define a column width for the speech bubble

-n

Do not wrap words

Examples and Advanced Usage

With Tux (Linux penguin)

fortune | cowsay -f tux

2024-10-24_12-55

edit .bashrc

2024-10-24_12-56

Terminal window showing Tux ASCII art with a fortune message in a speech bubble

Stegosaurus

fortune | cowsay -f stegosaurus

2024-10-24_12-58

edit .bashrc

2024-10-24_12-58_1

Terminal window showing a stegosaurus ASCII art with a fortune message in a speech bubble

Pipe with Other Commands

You can pipe other commands output to cowsay. For example, print the directory contents:

ls | cowsay -f stegosaurus
2024-10-24_13-01

Terminal window displaying a stegosaurus in ASCII art with directory contents in a speech bubble

Custom Text

You can also use cowsay with custom text:

cowsay -f tux "Welcome to Linux!"
2024-10-24_13-04

Terminal window showing Tux ASCII art with custom message inside a speech bubble: ‘Welcome to Linux!’

Conclusion

Welcome messages are a fun way to personalize the command-line experience with customized Linux terminals. Such tools as fortune and cowsay allow for creativity in what sort of message you want to be displayed. You just have to decide how it should appear, what characters you are going to use, and even the beauty of the display.

Cool Custom Welcome Messages on Linux – FAQs

What are the benefits of customizing my Linux terminal’s welcome message?

  • Adds personalization and uniqueness
  • Displays useful system information or reminders
  • Improves your Linux scripting skills
  • Shows company info in workplace settings

May I add images or graphics to the welcome message in my terminal?

No, terminals don’t support actual images. However, you can use ASCII art tools like “cowsay” or “figlet” to create text-based graphics.

How often can I change the welcome message in my terminal?

You can change it anytime. The message can be static or dynamic, and you can even automate changes based on time, date, or system status.

Will personalizing my terminal welcome line impact how it performs?

Simple welcome messages won’t affect performance. Complex scripts fetching real-time data might cause minor startup delays.

Can I have welcome messages for different kinds of users on the same system?

Yes, each user can have their own welcome message since they’re set in user-specific configuration files.



Next Article

Similar Reads

three90RightbarBannerImg