bash:colors
This is an old revision of the document!
Table of Contents
BASH - Colors
You can use these ANSI escape codes:
No Color | 0 | ||
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 |
Red Example
echo -e "\033[0;31mThis is in RED"
Red Blue
ANSI Rainbow
for (( i = 30; i < 38; i++ )); do echo -e "\033[0;"$i"m Normal: (0;$i); \033[1;"$i"m Light: (1;$i)"; done
References
bash/colors.1610194691.txt.gz · Last modified: 2021/01/09 12:18 by peter