Last Updated :
12 Apr, 2025
If you’ve been working in the Windows Command Prompt and your screen is cluttered with text, knowing how to clear the Windows Command Prompt screen can make your workspace much tidier and easier to manage. This simple task can help you focus on the commands you’re working on without distraction.
In this guide, we’ll show you different methods to clear the screen in CMD using various techniques, making your work in the Windows Command Prompt more efficient.
Methods to Clear Command Prompt Screen
In the below section, we are going to discuss different approaches to clearing the command prompt (CMD) screen. So keep reading the section and find the best method.
Method 1: Clear CMD Screen Using the cls command
The easiest way to clear the Command Prompt screen is by using the «cls» command in the following manner.
- Press «Win + R«. It will open the «Run» dialogue box.
- Type «cmd» and press Enter to open the Command Prompt.
- Type «cls» and press Enter. This command will instantly clear the screen, giving you a clear workspace. It’s a quick and effective method.
Note: Windows PowerShell can also be used instead of cmd as well.
Example: We are downloading the Python library using cmd and then will clear the screen.
Output:
Method 2: Clear the Command Prompt Screen using the Shortcut Key
Some systems allow keyboard shortcuts for clearing the Command Prompt screen. By pressing «Ctrl+L«, we can clear our screen. This shortcut is a time-saver.
Example:
Method 3: Use Closing and Reopening to Clear Command Prompt
While this approach is not very efficient as compared to the other two, it can be used in cases when other methods are not available or during system default or error. All one can do is close the current cmd screen and reopen it to get a clear screen.
Example:
Method 4: Clear the Command Prompt (CMD) Screen Using Reboot
To clear the Command Prompt (CMD) screen using a system reboot, you can’t directly do it because rebooting the system closes all running programs, including the Command Prompt window. It’s like turning off your computer and turning it back on, which resets everything. Make sure you have saved all your ongoing work before this. Here’s a step-by-step guide on how you might approach this:
- Open Command Prompt.
- Type `shutdown /r /t 0` and press Enter.
- Confirm the restart if prompted.
- Wait for the system to reboot. Upon restart, the Command Prompt screen will be cleared.
Example:
Your browser does not support the video tag.
How to View Command Prompt Command History?
Additionally, you can also view your command prompt history using the F7 shortcut key. All the previously used commands can be found by pressing the «F7» key. Pressing it will give a list of recently used commands, making it easier to reuse them in your current session.
How to Save Command Prompt History?
Also, you can save the command history in the form of a text file in cmd in the following manner:
- Open the Command Prompt.
- Type the command: «doskey /history > history.txt» and press Enter. This will export your command history to a file named «history.txt.»
- Search for this file in your system and you may find all your cmd history commands there.
Example:
Output: The txt file will look like this.
Other Shortcut keys for the Command Prompt Screen
- Ctrl + C: Stop the currently running process and move the cursor to a new blank line
- F7: To View Command Prompt Command History
- Ctrl +Backspace: To remove one word to the left of the cursor
- ESC: To clear current input command text.
To sum up, it’s very important to keep our cmd screen clean and organized as it makes the system more efficient and also provides ease of use for users, thus, we should know about all these methods. As mentioned, we can use any method given above according to our convenience and need.
Conclusion
Clearing the Command Prompt screen is a straightforward process that can significantly improve your workflow by providing a clean slate for new commands. Whether you prefer using a quick shortcut or typing out a command, the methods outlined in this guide will help you efficiently clear the CMD screen whenever needed. With these tips, you can keep your Command Prompt environment organized and easy to navigate.
Enter the CLS command to clear everything, or press Esc to erase what you were typing
What to Know
- Type cls as a new command, and press Enter. This clears the entire screen.
- Another way to erase the CMD screen is to reopen the program. Or, you can enter Start to launch a new instance.
- Press the Esc key to wipe the line of text you’re actively typing. This will not affect the rest of the screen.
This article explains how to clear the screen in Windows’ Command Prompt application. You can use a short command to erase what’s on the screen, or just reopen the program. We also have a bonus section at the end for clearing a line, character, or word.
How to Clear the Screen in Command Prompt
Unlike many things on your computer, there aren’t several ways to wipe everything from Command Prompt. Instead, there’s one basic command that will rid the screen of its history.
Enter the Clear Screen Command
When you’re ready to erase everything in Command Prompt so you can start fresh, type the following command and press Enter:
cls
This command must be executed by itself for it to work. If you see an error message that says what you wrote isn’t recognized as a command, delete any text before and after CLS. Keep reading to learn how to do that.
Reopen Command Prompt
The only other way to clear all the text from Command Prompt is to just close it. If, for some reason, you can’t issue the CLS command, shut down the program by typing exit or pressing the X at the top. Then, open Command Prompt again.
If you enter the command start, it will open a new instance of Command Prompt without closing the first one. This is useful if you want a clean screen to enter some new commands, but you don’t want to lose all the progress you’ve already made.
Bonus: Clear Text on the Command Prompt Screen
Maybe you don’t necessarily need to clear the entire Command Prompt screen, but just the current line or some text in it. Here are a few helpful key presses to keep in mind:
- Esc: Clear the current line of text. It removes the text and moves your cursor back to the start of the prompt.
- Backspace: Delete one character to the left of your cursor.
- Ctrl+Backspace: Delete one word to the left of your cursor.
- Ctrl+C: Stop the line you’re typing or the command you’re running and move to a new prompt on the following line.
- Arrow keys: Move left and right within the active line to erase or edit your command.
FAQ
-
Your command history clears every time you close the Command Prompt. Close the window manually or use the Alt+F4 keyboard shortcut.
-
Use the help command: Enter help to see a list of available commands. To get more information about a particular command, type help command name.
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
-
Home
-
News
- [SOLVED] How to Clear Command Prompt Screen Windows 10
By Alisa |
Last Updated
This post provides quick ways to clear Command Prompt (cmd.exe) screen in Windows 10. For troubleshooting Windows problems, MiniTool software also provides some free tools like free data recovery software, hard drive partition manager, PC backup software, etc.
Windows Command Prompt (cmd.exe) lets us quickly open applications, execute tasks, troubleshoot some Windows issues, etc. by typing command lines. After you type many command lines and finish the tasks, or type wrong command lines, how to clear Windows Command Prompt screen in Windows 10?
Check the easy ways below for how to clear CMD screen in Windows 10.
Clear Command Prompt Screen with CLS Command
After you open Command Prompt in Windows 10, and enter multiple command lines in the screen, you can type cls command line in Command Prompt window, and hit Enter button. This will clear the CMD screen in Windows 10. All typed previous commands in Command Prompt window will be cleared.
Close Command Prompt and Open It Again to Clear Screen
You can also close Command Prompt window and open again, it will also clear the Command Prompt screen in Windows 10.
Clear Command Prompt Screen with Keyboard Shortcut?
If the Command Prompt window is cluttered and you want to clear the screen, you may wonder if there is a keyboard shortcut to easily clear it. Some online posts suggest using Alt + F7 keyboard shortcut to clear the command history. But I tried this way, it doesn’t work.
How to View Command Prompt Command History
After you type a series of command lines in Command Prompt window, you can type doskey /history command line, and hit Enter. This command will display all the commands you typed in the same sequence as you entered.
To view all command lines you entered in Command Prompt window after you access CMD, you can also press F7 key. This will pop up a window with a list of all previous typed command lines. You can use the Up and Down arrow key to select any command line in the list and press Enter to locate it.
How to Save Command Prompt History
You can enter this command line doskey /HISTORY > filename.txt to save the commands history to a TXT, HTML, CSV, RTF file. You can enter a file name and a file extension. The file will be saved to the location where you execute this command.
What You Can Do with Command Prompt
You can use Windows Command Prompt to do many things. Below we introduces three common usages of Command Prompt. Press Windows + R, type cmd, and hit Enter to open Command Prompt.
Organize Your Hard Drive Partitions
You can run Windows Diskpart utility in Command Prompt to manage computer hard drive partitions.
You can type diskpart in Command Prompt window to open Windows Diskpart tool. Below is how to partition external hard drive with Diskpart.
- list disk
- select disk * (select the external hard disk)
- create partition primary size=* (specify a partition size in MB)
- assign letter=* (set a drive letter for the new partition)
- format fs=ntfs quick
- exit
Check and Repair Disk Errors
You can also type chkdsk *: /f /r command in Command Prompt, and hit Enter to use Windows CHKDSK to check and repair hard disk errors. Replace “*” with the target partition drive letter.
Detect and Repair Corrupt System Files
If your computer has problems, you can use Windows SFC tool to check and repair corrupted system files. You can type sfc /scannow command in Command Prompt, and hit Enter to use SFC tool to find and repair corrupted/missing system files.
Verdict
In conclusion, the easiest way to clear Command Prompt screen is to use CLS command or restart Command Prompt application.
About The Author
Position: Columnist
Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.
Все способы:
- Способ 1: Очистка текущей строки
- Способ 2: Скрытие всех записей
- Способ 3: Пользовательский файл запуска
- Вопросы и ответы: 0
Способ 1: Очистка текущей строки
Избавиться от введенного ранее текста в «Командной строке» Windows 10 можно с помощью всего одной кнопки на клавиатуре – «ESC». После нажатия клавиши все символы без исключения будут удалены по аналогии с многократным нажатием клавиши «Backspace».
Основной альтернативой кнопке «ESC» в Windows 10 выступает сочетание клавиш «CTRL+C», которое присутствует в большинстве операционных систем с консолью. В этом случае все символы со строки будут моментально удалены, произведен автоматический переход на новую строку и остановлены любые ранее запущенные команды.
Клавишу «Backspace» можно также использовать для частичной, но более быстрой очистки консоли в сочетании с другими кнопками. Так, например, комбинация «CTRL+Backspace» позволяет удалять идущие друг за другом символы без пробелов, включая цифры и любые другие знаки.
Способ 2: Скрытие всех записей
Единственный доступный в настоящее время способ очистки всех записей в рамках рабочего окна «Командной строки» Windows 10 заключается в использовании указанной ниже команды. В этом случае после введения символов, регистр которых не играет никакой роли, и последующего нажатия «ENTER», все данные на экране будут удалены и сброшены до одной единственной стартовой строки.
cls
Помимо данной команды, как нетрудно догадаться, всегда можно вручную закрыть консоль с помощью крестика в углу экрана или комбинации клавиш «ALT+F4», что приведет к автоматической очистке. Однако здесь важно учитывать, что выполняемые команды, как правило, не останавливаются до завершения или нажатия «CTRL+C».
Способ 3: Пользовательский файл запуска
Хоть это не особо критично на первый взгляд, вполне можно начать работу с изначально полностью чистой консолью без дополнительных данных о версии системы и разработчике. Для этого откройте стандартный «Блокнот» или любой другой текстовый редактор и одной строкой укажите следующее содержимое.
cmd /k cls
Данный документ необходимо сохранить в любом удобном месте с расширением «.bat» и в будущем использовать в качестве ярлыка запуска «Командной строки». Только в таком случае она будет открываться с одной единственной строкой, будь то «С:\Windows\system32» или пользовательское расположение, что вполне можно контролировать через дополнительные команды в файле.
Наша группа в TelegramПолезные советы и помощь
The clear
command in Linux is used to clear the terminal’s screen.
You can also use the clear
command in a Windows PowerShell where it is an alias of the Clear-Host
command, that does pretty match the same – removes all text from the current display, including commands and output that might have accumulated.
But if you try to execute the clear
command in a Windows command-line prompt (CMD), expecting it to clear the screen, you will get an error as follows:
‘clear’ is not recognized as an internal or external command,
operable program or batch file.
Below you will find how to clear the command prompt in Windows.
To clear the screen in the Windows command-line prompt (CMD), use the cls
command:
C:\> cls
Was it useful? Share this post with the world!