Journal 2022-06-19
Terminal codes
You can change the style of some text in the terminal with escape codes. You
can use escape codes by printing \e[<...>m
.
Some useful ones are:
- reset:
\e[0m
- bold:
\e[1m
- italic:
\e[3m
- faded:
\e[2m
- underlined:
\e[4m
strike-through:\e[9m
- red foreground/background:
\e[31m
,\e[41m
- green foreground/background:
\e[32m
,\e[42m
- yellow foreground/background:
\e[33m
,\e[43m
- blue foreground/background:
\e[34m
,\e[44m
You can combine multiple colors with a ;
, for example for a bold error
echo -e '\e[1;31m[ERROR]\e[0m'