Name

cls

Synopsis

Clear the DOS window and buffer, leaving only the command prompt and cursor.

Description

Type cls at the prompt to clear the screen and the screen buffer (see Section 6.1, earlier in this chapter), which is useful for privacy concerns or simply reducing clutter.

The difference between using cls and simply closing the current Command Prompt window and opening a new one, is that your working environment (such as the current directory) is preserved with cls.

cls is also useful in complex batch files — for clearing the screen after one set of interactions or command output. The name cls (Clear Screen) refers to the old days when DOS owned the whole screen.

Get Windows XP in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.