You can see the colors in this chart1 as they would appear on your terminal fairly easily:
Although this is not a great example if you are happy with using bash's special \d or \D{format} prompt escapes -- which are not the topic of the question but can be found in man bash under PROMPTING. There are various other useful escapes such as \w for current directory, \u for current user, etc.
1. The main portion of this chart, colors 16 - 231 (notice they are not in numerical order) are a 6 x 6 x 6 RGB color cube. "Color cube" refers to the fact that an RGB color space can be represented using a three dimensional array (with one axis for red, one for green, and one for blue). Each color in the cube here can be represented as coordinates in a 6 x 6 x 6 array, and the index in the chart calculated thusly:
16 + R * 36 + G * 6 + B The first color in the cube, at index 16 in the chart, is black (RGB 0, 0, 0). You could use this formula in shell script:
#!/bin/sh function RGBcolor { echo "16 + $1 * 36 + $2 * 6 + $3" | bc } fg=$(RGBcolor 1 0 2) # Violet bg=$(RGBcolor 5 3 0) # Bright orange. echo -e "\\033[1;38;5;$fg;48;5;${bg}mviolet on tangerine\\033[0m" 