Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»Bash Shell»How to change Background Color of Text in Linux Shell

    How to change Background Color of Text in Linux Shell

    By RahulNovember 15, 20141 Min ReadUpdated:September 1, 2017

    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.

    Advertisement

    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

    bash color output text
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Sed Command to Delete Lines in a File

    Sed Command to Delete Lines in a File

    Sort Command in Linux with Practical Examples

    15 Practical Examples of Sed Command

    Sed Command in Linux with 15 Practical Examples

    View 3 Comments

    3 Comments

    1. Abdi Prawira on March 7, 2019 5:16 am

      Thanks rahul, keep it up buddy !

      Reply
    2. Andy on August 31, 2017 6:06 pm

      This only works for me if I include two backslashes before the escape e’s.

      Reply
      • Rahul K. on September 1, 2017 11:34 am

        Thanks Andy, I have updated the tutorial.

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.