Display Custom Text And Time Everytime You Open Terminal On Linux


Customizing terminal has always been a enjoyable trend and passion to Linux users, specially to those who are new to Linux. And this article is perfect for those who loves CLI rather than GUI. Wouldn’t you love to be able to customize your terminal, like in the picture below?

Perform the the steps below to achieve the same results as in the above image:

To show the customized text and date/time on terminal, we will need to install a small package named Figlet, and edit a system file named bash.bashrc. So lets start by installing Figlet.

Step 1 Install Figlet

For hardcore/advance users this ain’t even a step, you know what to do. For novice users follow the below to install figlet.

Open terminal and enter the following command, you will need root permissions to perform this task.
Sudo apt-get install figlet
Now the figlet package should be installed successfully, if not try below
Sudo apt-get update
then again,
Sudo apt-get install figlet
Step 2 Edit bash.bashrc File
Now that we have install our package lets add the customized text. Again you will need root permissions to edit and add your custom text.
To edit the file enter the following command on terminal
For CLI editor
sudo nano /etc/bash.bashrc
For GUI editor
sudo pluma /etc/bash.bashrc
Or use whatever your favourite text editor is.

Now scroll to the end of the file and then add your custom text and save it like in the image below,

I want to show ‘sombii@sombex’, so I typed that.
Again lets add the date/time, to show date/time type ‘date’ below on new line after your customized text. You have successfully added the custom text, see for yourself by opening a new terminal.

You can be happy with what it looks like or you can customize format of date/time. You can show only the date or only time and in other formats too. View examples below.

To show date only,

date +"%m-%d-%y"

To show time only,

date +"%T" Or for 12-hr clock time date +"%r"

If you want to learn more about date/time formatting here’s an article for it.

So thats all, hope that you were able to follow the instructions without any issues, if any please comment below. I would love to help you.

No comments

😉 Adblocker detected!! 😉

Please disable your adblock or atleast whitelist us. We work hard to deliver useful content for you, in return we are politely asking you to view ads on side site. It is the only source of our income. Hope you understant.

Click below to refresh the Page.

Thank you.