TOOL » LINUX » PACKAGE

Tput

Usage

Make terminal-dependent capabilities and information available to the shell.

shell
tput CAPNAME
Capability nameDescription
boldOutput bold text.
sgr0Output normal text.
setaf [0-9]Set foreground color.
setab [0-9]Set background color.
linesNumber of lines in the terminal.
colsNumber of columns in the terminal.

Color table

ValueColor
0Black
1Red
2Green
3Yellow
4Blue
5Magenta
6Cyan
7White
8Not used
9Reset to default color

Example

shell
echo "This text is $(tput bold)bold$(tput sgr0). This text is normal."