Go to the first, previous, next, last section, table of contents.


Using tput

The format of the tput command is illustrated below.

tput [options] capability [parameter ...]
tput [options] longname
tput [options] init
tput [options] reset

GNU tput takes the following options:

[-T terminal-type] [--terminal=terminal-type] 
[-t] [--termcap]
[-S] [--standard-input]
[-V] [--version]

Some string capabilities accept parameters, such as the number of lines to delete or the column to move to. These parameters are specified on the command line following the capability name. They are always numbers.

`-T termtype'
`--terminal=termtype'
This option indicates the type of terminal. By default, this value is taken from the `TERM' environment variable.
`-t'
`--termcap'
GNU tput by default accepts termcap name if the capability a user specifies is not a terminfo name. This option tells tput not to try terminfo names and look up only termcap names.
`-S'
`--standard-input'
This option tells tput to read a sequence of capabilities and parameters from the standard input. Only string capabilities can be used in this mode.
`-V'
`--version'
This option displays the version of tput.

When `longname' is specified, tput displays the long descriptive name for the terminal type.

When `init' is specified, tput sends the initialization strings for the terminal. If the terminal's tab width is other than 8, and it cannot be reset, the tab expansion in the tty driver is turned on. Otherwise, tab width is reset to 8 and the tab expansion is turned off.

When `reset' is specified, tput sends the reset strings for the terminal and then follows the same initialization sequence as tput `init'.

Below are some example uses of tput. See section Capabilities, for a complete list of the functions that tput can cause terminals to perform. Note that not all terminals can perform any given function. See section Yet More Examples, for some more complex samples of tput use.

The following command moves the cursor to row 10, column 30 of the screen:

tput cup 10 30

The following command makes the cursor invisible:

tput civis

The following command makes the cursor visible again:

tput cnorm

The following command deletes 10 lines below and including the one on which the cursor is positioned:

tput dl 10


Go to the first, previous, next, last section, table of contents.