Previous Table of Contents Next


Module 19
clear

DESCRIPTION

The external clear command clears your terminal screen if possible. It searches your environment for the TERM(terminal) variable, then looks in the /usr/lib/terminfo/?/TERM database or the /etc/termcap file to determine how to clear the screen.

COMMAND FORMAT

Following is the general format of the clear command.

     clear

DIAGNOSTICS AND BUGS

If your terminal variable is not set to the correct type of terminal, your screen may not be cleared. If your terminal does not clear and/or strange characters appear, you probably need to set your terminal type variable. Refer to Module 99 on how to set environment variables.

RELATED COMMANDS

Refer to the tput command described in Module 139.

RELATED FILES

The clear command looks up the proper characters to clear your screen in the/usr/lib/terminfo/?/TERM database or the /etc/termcap file.

APPLICATIONS

The clear command is used to clear your terminal screen. You may find this useful just to clean up your screen while working at your terminal. The clear command is often used in shell scripts to clear the screen before presenting a menu or data output. Some users place the clear command in their logout file, so when they log out their terminal screen is cleared.

TYPICAL OPERATION

In this activity you use the clear command to clear your terminal screen. Begin at the shell prompt.

1.  Type clear and press Return. Your terminal screen should be cleared and your shell prompt will return at the top of the screen.
2.  Turn to Module 139 (SV), Module 128 (BSD) to continue the learning sequence.


Previous Table of Contents Next