How to change the output color of echo in Linux

后端 未结 29 4156
刺人心
刺人心 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 05:06

    And this what I used to see all combination and decide which reads cool:

    for (( i = 0; i < 8; i++ )); do
        for (( j = 0; j < 8; j++ )); do
            printf "$(tput setab $i)$(tput setaf $j)(b=$i, f=$j)$(tput sgr0)\n"
        done
    done
    

提交回复
热议问题