cmd | cls command

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.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.