The Command Prompt (CMD) is a powerful Windows tool that lets you use commands to do things you wouldn’t otherwise be able to do with your system. But before you start using CMD, you should know at least elementary commands. And one of them is the command to clear its screen.
The most straightforward way to clear the Command Prompt screen is by using the built-in
cls command. “CLS” stands for “Clear Screen,” and it does exactly what its name suggests: it clears the contents of the Command Prompt window, giving you a fresh, empty workspace.
Of course, you can clear the Command Prompt by simply closing it and opening it again. But that way is for weaklings, isn’t it?
So let’s take a closer look at how it works below.
How to clear the Command Prompt on Windows
As mentioned, everything is simple here. You just need to use one command suitable for CMD on Windows 10 and 11. So follow these steps:
- Suppose you’re in Command Prompt already.
- Press Enter to move to a new line and type
- Finally, press Enter again.
Voilà – the Command Prompt screen is now cleared.
And that’s actually it. There are no other ways to remove all the text from CMD altogether. It works the same way in PowerShell (Terminal on Windows 11).
How to delete text in Command Prompt on Windows
Whether you’re typing commands, paths, or any other text, it’s common to make mistakes or need to correct what you’ve entered. Fortunately, Windows Command Prompt provides several methods to delete text efficiently.
Using Backspace and Delete keys
The simplest way to delete text is by using Backspace and Delete keys. Here’s how they work:
- Backspace: Pressing the Backspace key deletes the character to the left of the cursor.
- Delete: Pressing the Delete key deletes the character to the right of the cursor.
- Ctrl + Backspace: Deletes the word to the left of the cursor.
For some reason, it doesn’t work so with the Ctrl + Delete combination.
Using the Esc key
Esc key will clear the current input line, effectively deleting all the text you’ve typed on that line. This can be helpful if you want to start over without moving the cursor around to delete individual characters.
Can I check my Command Prompt history?
Yes, you can definitely do it. The Command Prompt in Windows maintains a history of the commands you’ve entered, allowing you to access and reuse previously executed commands quickly. There are several ways to do this. Let’s look at each of them.
Using the Arrow keys
You can use the Up and Down arrow keys to navigate your command history in the Command Prompt.
Pressing the Up arrow key will cycle through previous commands you’ve entered, while the Down arrow key will cycle through commands you’ve recently entered.
Once you’ve selected a command, press Enter to execute it again.
Using the F7 key
Pressing the F7 key in the Command Prompt window will reveal a small window displaying your command history in a list format. You can use the arrow keys to navigate the list and select the command you want to reuse.
Press Enter to execute the selected command.
Using the “doskey” command
doskey command allows you to manage and recall previous commands in the Command Prompt. You can use the following syntax to display your command history:
This will list the commands you’ve entered during your current session. You can use the arrow keys to scroll through the list. Press Enter to select the command you need.