ascii encoding

hexadecimal dump of ascii charaters

from man ascii

The control characters in ASCII still in common use include:

to see the hex value for characters

od -t a -t x1 -t c

e.g.

> printf '\0\a\b\n\r\t\v ' | od -t a -t x1 -t c
0000000  nul bel  bs  nl  cr  ht  vt  sp
          00  07  08  0a  0d  09  0b  20
          \0  \a  \b  \n  \r  \t  \v
0000010

Understanding the color escape code

explanation, engineering,

\033[XXXm is Select Graphic Rendition subset of ANSI escape sequences, \033 is actually ESC character in ascii octal format, \e is equivalent in zsh shell, however, don’t use \e, \e is not recognised in awk nor python.

> echo "\033[31mRed Text\033[0m"
Red Text
> echo "\e[31mRed Text\e[0m"
Red Text
code description
30, 90 fg black
31, 91 fg red
32, 92 fg green
33, 93 fg brown
34, 94 fg blue
35, 95 fg purple
36, 96 fg cyan
37, 96 fg light grey
40 bg black
41 bg red
42 bg green
43 bg brown
44 bg blue
45 bg purple
46 bg cyan
47 bg light grey
0 reset / normal
1 bold
3 italic
4 underline
> for i in {1..111}
do
    echo '\\e['$i'm' "\e[${i}mtext\e[0m"
done | column
bash color

See also: a comprehensive explanation