Open In App

cmd | cls command

Last Updated : 29 Sep, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

Cls is a internal command found inside windows command interpreter cmd, that is used for clearing the console window.
It does so by removing the entry of all previously entered commands, and their corresponding outputs. The command was first introduced in the MSDOS Version 2. Initially it was for command.com (command processor for MSDOS), which is the predecessor of cmd.exe (AKA Command Prompt).
It is one of the most used commands, and is offered by all Operating Systems in one way or another (ex. Linux has a command named clear which serves the same purpose). In this article, we would learn about this command and how to use it.

Description of the Command :

CLS : Clears the screen.

Note –
In order to obtain the above text execute the cls /? command on cmd.

Using Command :
The command serves only one purpose, and that is to clear the output screen. For doing so execute the command without any parameters.

Example –
For this example, we would be using the following console window.

This window currently contains output from the dir command. In order to clear this output (and others before it) execute the CLS command. After command execution, the windows appear as follows.

It is clear that from the above image, that all the previous output has been removed.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads