clear1
Clear the terminal screen
Usage
clear [-x]
[-T
terminal-type]
clear -V
Overview
clear clears your terminal's screen and its scrollback buffer, if any. clear retrieves the terminal type from the environment variable TERM, then consults the terminfo terminal capability database entry for that type to determine how to perform these actions.
The capabilities to clear the screen and scrollback buffer are named “clear” and “E3”, respectively. The latter is a user-defined capability, applying an extension mechanism introduced in ncurses 5.0 (1999).
Options
clear recognizes the following options.
-
-T type -
produces instructions suitable for the terminal type. Normally, this option is unnecessary, because the terminal type is inferred from the environment variable TERM. If this option is specified,
clearignores the environment variables LINES and COLUMNS as well.
-
-V -
reports the version of ncurses associated with this program and exits with a successful status.
-
-x -
prevents
clearfrom attempting to clear the scrollback buffer.
Portability
Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7 (POSIX.1-2008) nor X/Open Curses Issue 7 documents clear.
The latter documents tput, which could be used to replace this utility either via a shell script or by an alias (such as a symbolic link) to run tput as clear.
Releases
15 releases since Debian 2.1 (Slink); the text changed 12 times.
-T since Debian 10 (Buster);
-V since Debian 10 (Buster);
-x since Debian 10 (Buster).