How to change Terminal colors.

This How To uses some of the stuff described in The Basics.
The following sites helped out in writing this How to:
Linux Self Help
Life Hacker

Changing the Terminal colors to something that looks interesting or even l33t.

Here is the “boring” version:

Now I’ve already changed the Schema. (Settings->Schema->White on Black)
I just like stuff to be on a black background. 😀

So how do we change the colors like almost everything in Linux Terminal has a config file it’s located at:


Now we have to write some functions to take care of the coloring.  Open ~/.bashrc in nano:

nano ~/.bashrc

Add the following code to the end of this file:

function elite

local GRAY="[33[1;30m]"
local LIGHT_GRAY="[33[0;37m]"
local CYAN="[33[0;36m]"
local LIGHT_CYAN="[33[1;36m]"
local BLUE="[33[0;34m]"

case $TERM in
local TITLEBAR='[33]0;u@h:w07]'
local TITLEBAR=""

local GRAD1=$(tty|cut -d/ -f3)
$CYAN$(date +%H%M)$GRAY/$CYAN$(date +%d-%b-%y)

Close you Terminal and open it again.
This is what it looks like:

Now it doesn’t yet does it?
That’s because we have to call the function:


There l33t Terminal colors.
If you want the colors to stay like this without having to call the function first, add the function call to the bottom of the ~/.bashrc file.

Lets explain what where seeing in the elite function when we call it because it has some extra information.
we see:



–(madberry@Pernicious): Username@Hostname
-(3/pts): Commands executed/Terminal your in(will show tty2 when you change to ctrl+alt+F2)
-(1728/07-Aug-08)–: time and date
-($:~)–: What you would normally find behind Usernae@hostname shows current path behind $.

Here is another option(which I just added to my file I like options):

function prompt
local WHITE="[33[1;37m]"
local GREEN="[33[0;32m]"
local CYAN="[33[0;36m]"
local GRAY="[33[0;37m]"
local BLUE="[33[0;34m]"
export PS1="
${GREEN}u${CYAN}@${BLUE}h ${CYAN}w${GRAY}$ "

Close and open Terminal.
This can be called with:


And this is what it looks like:
Same deal here if you want to keep the colors like that add prompt to the end of the ~/.bashrc file.

Now what if we want to just go back to what it was add this to the file:

function clback
local WHITE="[33[1;37m]"
export PS1="

Now if you call:


It changes the color back to white keep in mind that this is designed by me for the white on black color schema if your Terminal background is white then you won’t see anything.

Happy coloring 😀

Comments are closed.

Powered by: Wordpress