Preamble
Bash colors are used in your default GNU/Linux shell, bash. However, neither the bash manpage nor the Internet gives any explanation on how to manipulate colors. Alas, I'll write a little howto.
How to use them
First of all, you want to use colors in your ~/.bashrc, where you set the primary prompt of bash, PS1. Secondly, mostly for scripting or testing of colors, you can use ``echo -e'' to parse the colors and give the colored output on to whatever terminal [emulator] you're at.
echo -e '\e[31;1mRed bold text \e[0mUnformatted text'
Tabular overview
Well. While I was writing this, I came to realise that you'd be sitting with your bash prompt now, and the best thing to do would be to make you run this command:
for first in {0..47}; do \
for second in {0..8}; do \
printf " \\e[%u;%um%s[%0.2u;%0.2um\e[0m " $first $second "\e" $first $second; \
done; \
echo; \
done
This should give you a nice overview of how the colors are interpreted. Also, I would suggest adding this bash alias (to your .bash_aliases or whatever is sourced when you start bash). It is really only the above in a cramped and unreadable form.
alias bashcolors='for first in {0..47}; do for second in {0..8}; do printf " \\e[%u;%um%s[%0.2u;%0.2um\e[0m " $first $second "\e" $first $second; done; echo; done'
This'll allow you to get an overview whenever you need it.
Errors and disclaimer
The information above was put together very quickly, and probably isn't exhaustive. It's clear that the shell or whatever program which generates colored output inserts the special \e escape sequence, and that the terminal emulator then understands that as colors, thus rendering them on the screen.
There could easily be more colors that some terminals will render. In example, vim uses some variations of colors that the ordinary Linux console doesn't know, while rxvt does. Such colors exist, in other words, but the question is how to get to them in bash. I haven't really cared, but if you know, fill me in.
If you have any suggestions, corrections or complaints, I'm reachable at skrewz@skrewz.dk.