It is extremely easy to add a plain-text welcome message in Linux terminal. All you are have to do is to include echo command in your shell startup file.
For example, if you are using bash, you can edit ~/.bashrc script, and add echo command at the beginning of the script as follows.
# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples echo "This is my welcome message" . . .
At this point, whenever you open a new terminal window, the message will appear inside the terminal window.
A custom welcome message can be used to spice up your terminal window. For example, here is a simple tip that makes a random quote appear inside your Linux terminal.
We use a combination of two command-line tools: fortune and cowsay. The former tool prints out a random interesting adage, and the latter utility displays (literally) a speaking cow in terminal window.
First, install fortune and cowsay on Linux.
On Debian, Ubuntu or Linux Mint:
On Fedora, CentOS or RHEL:
Then add the following line at the beginning of ~/.bashrc.
# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples fortune | cowsay -pn . . .
That's it. Now go ahead and open a new terminal window. You will see something like this in your terminal window.
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!