0

How to print message from echo command with color

I print the message using echo command. But, is it possible to view it in various color formats.

Echo Linux Add a comment
andrew
asked May 04 2017

Answer

0

Jus use -e option in echo command as follows,

To display output in green color,

#  echo -e "\033[32m hello world"

Other color codes as follows,

Black       30
Red         31
Green       32
Yellow      33
Blue        34
Magenta     35
Cyan        36
White       37

Note: \033[ is default, change 32 to other codes.

Add a comment
jagannatharumugam
asked May 04 2017
edited Oct 05 2018
Post your Answer