How to Clear the CMD Screen with cls
Clear a cluttered Windows Command Prompt with cls. It hides visible output without deleting files or command history; compare it with PowerShell and Bash.
Start Interactive LessonSearches like clear cmd, cls command, and clear screen usually mean the same problem: the window is full of output and you want a clean prompt. In Command Prompt, use cls. Microsoft documents it as CLS. Practice it in the cls lesson.
Clear the preview and return to a fresh prompt
What cls does
cls has no switches. It clears the visible console buffer so you see a fresh prompt. It does not:
- delete files or folders
- undo commands you already ran
- close Command Prompt
- wipe the session’s command history (Up Arrow still recalls previous lines)
If the goal is a new session, type exit and open cmd again. If the goal is to see files, that is dir, not cls.
Clear the window without closing cmd
Type cls and press Enter. The prompt returns at the top of the window. That is the whole command. The preview above deliberately shows no output line because cls clears the display instead of printing a success message.
There is no official cls /history switch. Keyboard “clear” shortcuts in other terminals do not apply to classic cmd.exe the same way.
If the screen still looks busy
cls only affects the visible console buffer. It does not close a second Command Prompt window, clear text copied into another application, or remove output that a running program is currently printing. Wait for the program to finish, press Ctrl+C only when you intend to interrupt it, and then run cls again.
cls vs PowerShell vs Linux
| Shell | Command | Same idea |
|---|---|---|
| Command Prompt | cls | Clear the visible window |
| PowerShell | Clear-Host or cls (alias) | Same visual reset |
| Bash / Linux | clear | Same visual reset |
cls is not clear in cmd. Typing clear in Command Prompt is usually an unknown command.
Common mistake
Thinking cls deletes history or files. It only hides previous output on screen. Files stay. The last commands stay in history.
FAQ
What command clears the screen in CMD?
cls
Does cls delete command history? No. Use Up Arrow to recall earlier commands.
Does cls delete files? No. It only clears displayed text.
What is the PowerShell equivalent?
Clear-Host. cls often works there as an alias.
Can I clear the screen with a shortcut?
cmd itself is the cls command. Other terminals may bind a key; do not assume it in Command Prompt.
Need the next built-in? help lists other Windows commands.
Knowledge Check
1 / 2What does CLS stand for?
References
These documentation links provide authoritative details for the commands used in this article.
Up Next
Magic characters for file matching.