Skip to content

How to change Background Color of Text in Linux Shell

Advertisement

Command:

echo -e “\\e[0;41mBackground in Red Color\\e[0m”

The Above commands are using to set background color of output on Linux bash shell. In The output of above command background will be in red color. There are many other colors available which you can use defined as below. Just replace “0;41” with other color values in above text.

Other Color Codes’s:

   Black        0;40
   Red          0;41
   Green        0;42
   Yellow       0;43
   Blue         0;44
   Purple       0;45
   Cyan         0;46
   White        0;47

The 0m is used to reset the settings.

Background color of text in linux

Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top