Команда для очистки терминала windows

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.

  1. Press «Win + R«. It will open the «Run» dialogue box.
  2. Type «cmd» and press Enter to open the Command Prompt.
  3. 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.

Clear-CMD-Screen-Using-the-cls-command_1

Clear CMD Screen Using the cls command

Output:

Clear-CMD-Screen-Using-the-cls-command_2

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:

Clear-CMD-Screen-Using-Shortcut-Key_1

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:

Recording-2023-10-26-at-113415

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:

  1. Open Command Prompt.
  2. Type `shutdown /r /t 0` and press Enter.
  3. Confirm the restart if prompted.
  4. 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:

  1. Open the Command Prompt.
  2. Type the command: «doskey /history > history.txt» and press Enter. This will export your command history to a file named «history.txt
  3. Search for this file in your system and you may find all your cmd history commands there.

Example:

Recording-2023-10-26-at-114605

Output: The txt file will look like this.

to-Save-Command-Prompt-History_2

To save Command Prompt History

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.

  • Командная строка

  • Эмулятор терминала

На маке я использую для полной очистки терминала reset
Подскажите эквивалент на винде?
ctrl + L и CLS не устраивает


  • Вопрос задан

  • 9860 просмотров


Комментировать


Подписаться

1



Простой

Комментировать


Решения вопроса 1

  • kirillleogky, ну я вот только что так очистил и вверху ничего нет.

  • kirillleogky, ну так и нет же ничего сверху. Кручу колесо и ничего нет.

  • kirillleogky, покажите, в какой ситуации у вас там что-то есть.

Пригласить эксперта


Ответы на вопрос 2

ctrl + L и CLS не устраивает

А почему?

Ну если не нравится, то в powershell есть Clear-Host и его алиас clear


Комментировать


Ваш ответ на вопрос

Войдите, чтобы написать ответ


Похожие вопросы


  • Показать ещё
    Загружается…

Минуточку внимания

Windows Command Prompt (cmd.exe) lets us quickly open applications, execute tasks, troubleshoot some Windows issues, etc. by typing command lines. After working with the command prompt for a while in a single session, the command prompt window can become cluttered, so it is important to know how to clear the screen.

In this article, we will learn quick ways to Clear Command Prompt in Windows

Clear Command Prompt with CLS Command

This method is the most genuine and easiest method to clear the Command prompt you just need to type "cls" on the command prompt and your screen will be clear. Please follow the steps below:

Open the Windows Search Bar, type Command Prompt, and click on Open

Open Command Prompt

Enter multiple standard commands into the blank cmd screen.

Next type CLS and press Enter button. This will clear all the previously entered commands from the CMD screen in Windows.

Cls command to clear cmd screen

Keyboard Shortcut to Clear Command Prompt Screen

There are no keyboard shortcuts to clear the screen in command Prompt, but you cal press ESC to clear the input line and Cntrl + C to move the cursor to the new blank line.

But If you really want to clear CMD with a keyboard shortcut then you have to use the AutoHotkey and write the following script that sends cls<Enter> to the open command prompt window.
 

; -------------------------------------------------------------------------
; Keyboard Shortcut Cntr + L should clear CMD screen
; -------------------------------------------------------------------------
#IfWinActive ahk_class ConsoleWindowClass
^L::
Send cls{Enter}
return

#IfWinActive

Working of Script

  • First, the script will check if one is within a console application
  • And if CTRL+L is pressed
  • Write cls to the console and then hit ENTER

How to View CMD Commands History?

Open the command prompt and type doskey /history command line, and hit Enter. This will display all the commands you previously entered in the same sequence.

Run doskey/history

View Command History

Alternatively, you can also press Press F7 to see all previously entered commands.

Press F7 to view command history

How to Save Command Prompt History?

Sometimes you may need to save your history of command you typed in a Command Prompt window for the future. For this just need to type command doskey /history > filename.txt and press Enter.

For example:

doskey /history > D:\python\commands.txt

Save Command History

Next, you can save the Commands history in a TXT, HTML, CSV, RTF file.

Alternatively, you can also run the doskey /history command, and then copy & paste command history to another application and save it.

Conclusion

There is one method to clear the command prompt screen in Windows and i.e. run cls command, but if you are bounded to use keyword shortcut to clear the cmd screen then you have to write a custom script using AutoHotKey as explained above in the article.

Hope this article be helpful for you.

  • 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.

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

use Command Prompt to manage partitions

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.

CHKDSK command

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.

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!

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как поменять цвет меню пуск windows 10
  • Windows live mail установить
  • Комбинация клавиш для выключения экрана windows 10
  • Сколько шрифтов можно установить в windows 10
  • Не обновляется discord на windows 10