Text files don't permit formatting. Actually you can write down color escape sequences together with the text, but you have to use an application able to interpret them in order to see the colors, the bold text and so on. Example:
Code:
$ echo -e '\e[4;31mThis text is red underlined\e[0m' > file
Then if you use cat you should see the color:
Code:
$ cat file
This text is red underlined
The option -v of cat reveals the actual content of the file:
Code:
$ cat -v file
^[[4;31mThis text is red underlined^[[0m
You can find a list of color escape sequences in this ArchWiki page:
https://wiki.archlinux.org/index.php...rompt_and_Bash.