How to change the output color of echo in Linux

后端 未结 29 4048
刺人心
刺人心 2020-11-22 04:28

I am trying to print a text in the terminal using echo command.

I want to print the text in a red color. How can I do that?

29条回答
  •  情话喂你
    2020-11-22 04:46

    to show the message output with diffrent color you can make :

    echo -e "\033[31;1mYour Message\033[0m"
    

    -Black 0;30 Dark Gray 1;30

    -Red 0;31 Light Red 1;31

    -Green 0;32 Light Green 1;32

    -Brown/Orange 0;33 Yellow 1;33

    -Blue 0;34 Light Blue 1;34

    -Purple 0;35 Light Purple 1;35

    -Cyan 0;36 Light Cyan 1;36

    -Light Gray 0;37 White 1;37

提交回复
热议问题