The fastest way to clear your command prompt
Type cls and press Enter. That's it. The screen clears instantly, and your cursor moves to the top left. This works in Windows Command Prompt and PowerShell on Windows systems.
On Mac or Linux, type clear and press Enter instead. The effect is the same — everything on screen disappears, and you start fresh with a blank terminal window.
Both commands do the same thing: they remove all the text and output you've been looking at, but they don't delete any files, undo any commands, or change anything on your computer. They're purely visual — a way to make your workspace less cluttered.
Key Takeaways
- Windows Command Prompt and PowerShell use cls to clear the screen; Mac and Linux use clear.
- Clearing the screen removes only what you see on display, not any files or command history.
- You can also use Ctrl+L in some terminal programs, though this varies by system and shell.
- If you want to clear the screen and also wipe your command history, you'll need a separate command after clearing.
Why you might want to clear the screen
A cluttered command prompt makes it harder to spot errors, read output from new commands, or find where one task ended and another began. Clearing the screen gives you a fresh workspace so you can focus on what you're doing right now.
It's especially useful if you've been running many commands in a row and the window is full of old text. Clearing lets you see the results of your current command without scrolling up through everything that came before.
The difference between clearing and deleting history
Clearing the screen only removes what you see. Your command history — the list of commands you've typed — stays in memory. If you press the up arrow key after clearing, you'll still see the commands you ran before.
If you want to actually delete your command history, that's a different step. In Windows Command Prompt, type doskey /history:off to stop recording new commands, though this doesn't erase what's already been recorded. In PowerShell, you can use Clear-History to remove the history from your current session.
On Mac and Linux, type history -c to clear the history from your current session, or history -w to clear it and write the empty history to disk so it doesn't reload when you close the terminal.
Other ways to clear the screen
Some terminal programs respond to Ctrl+L, which clears the screen without typing a command. This works in many Linux and Mac terminals, but not reliably in Windows Command Prompt or PowerShell.
You can also close the terminal window entirely and open a new one, which gives you a blank screen. This is slower than typing cls or clear, but it also closes any running processes and starts completely fresh.
What happens to your files when you clear the screen
Nothing. Clearing the screen is purely visual. It doesn't delete files, undo commands, or change anything on your computer. If you ran a command that deleted a file before you cleared the screen, the file is still gone — clearing the screen doesn't undo it.
The same goes the other way: if you haven't run any commands yet, clearing the screen won't create or change anything. It's just a way to clean up what you're looking at.
Clearing the screen in different shells and systems
| System or Shell | Command |
|---|---|
| Windows Command Prompt | cls |
| Windows PowerShell | cls |
| Mac Terminal (bash or zsh) | clear |
| Linux Terminal (bash or other shells) | clear |
| Most Unix-like systems | clear |
Frequently Asked Questions
Does clearing the screen delete my command history?
No. Clearing the screen only removes what you see on display. Your command history stays in memory, and you can still access it by pressing the up arrow key. To actually delete your history, you need to run a separate command like Clear-History in PowerShell or history -c on Mac and Linux.
What's the difference between cls and clear?
cls is the Windows command; clear is the Mac and Linux command. They do the same thing — clear the screen — but Windows and Unix-based systems use different command names. If you type the wrong one, you'll get an error message.
Can I clear the screen without typing a command?
In some terminal programs, you can press Ctrl+L to clear the screen. This works in many Linux and Mac terminals but not in Windows Command Prompt or PowerShell. You can also close and reopen the terminal window, though that's slower.
If I clear the screen, will I lose my work?
No. Clearing the screen only hides what you're looking at. Any files you've created or modified are still there. Any commands you've run have already taken effect. Clearing the screen doesn't undo anything or delete anything — it's just a visual refresh.