Shell Color Output

user-pic
Vote 0 Votes

tput sgr0 # default terminal
tput setab [1-7] # Set the background color
tput setaf [1-7] # Set the foreground color

color is
0 black
1 red
2 green
3 yellow
4 blue
5 magenta
6 cyan
7 white

e.g. color output in red
# echo "`tput setaf 1`Red Color`tput sgr0`"
Red Color

ref. How to change the output color of echo in Linux

About this Entry

This page contains a single entry by Pank published on February 2, 2016 3:47 PM.

Brave Browser was the previous entry in this blog.

ISO 8601 Time Formats is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives