12.7. Terminal Control Commands

Command Listing

tput

Initialize terminal and/or fetch information about it from terminfo data. Various options permit certain terminal operations. tput clear is the equivalent of clear, below. tput reset is the equivalent of reset, below.

bash$ tput longname
xterm terminal emulator (XFree86 4.0 Window System)
	      

Note that stty offers a more powerful command set for controlling a terminal.

reset

Reset terminal parameters and clear text screen. As with clear, the cursor and prompt reappear in the upper lefthand corner of the terminal.

clear

The clear command simply clears the text screen at the console or in an xterm. The prompt and cursor reappear at the upper lefthand corner of the screen or xterm window. This command may be used either at the command line or in a script. See Example 10-24.

script

This utility records (saves to a file) all the user keystrokes at the command line in a console or an xterm window. This, in effect, create a record of a session.