The simplest way to clear your terminal
Type clear and press Enter. That's it. Your terminal screen empties, and your cursor moves to the top. The command works the same way on Mac, Linux, and Windows (if you're using PowerShell or Windows Terminal, not the old Command Prompt).
If clear doesn't work for you, try cls instead — it's the older Windows equivalent and still works on most systems. On a Mac or Linux machine, you can also press Ctrl+L as a keyboard shortcut that does the same thing as typing clear.
Clearing the screen doesn't delete anything. Your previous commands and their output are still in your terminal's history — you just can't see them on the screen anymore. If you scroll up in some terminal applications, you might still find them.
Key Takeaways
- Type clear and press Enter to empty your terminal screen on Mac, Linux, or modern Windows terminals.
- Use cls if clear doesn't work, or press Ctrl+L as a keyboard shortcut on Mac and Linux.
- Clearing the screen removes the visual clutter but does not delete your command history.
- You can scroll up in most terminal applications to see commands you ran before you cleared the screen.
When you might want to clear your terminal
You clear your terminal when the screen gets crowded with old commands and their output, and you want a fresh view to focus on what you're doing next. This is purely visual — it makes your work easier to read, but it doesn't change how your terminal works.
Some people clear the screen between different tasks, or before running a command they want to watch closely without distraction. Others clear it just before taking a screenshot to show someone else what they're working on. None of these reasons are required — it's a matter of preference.
What happens to your command history
Clearing the screen does not erase your command history. When you type clear, you're only telling your terminal to remove the text from the display. Your previous commands are still stored in memory and in your history file.
On Mac and Linux, you can see your command history by typing history and pressing Enter. This shows you a numbered list of commands you've run in the current session. You can also press the up arrow key to cycle backward through your recent commands one at a time.
If you actually want to delete your command history — not just hide it from view — that's a different task. You would need to clear the history file itself, which varies depending on which shell you use (bash, zsh, fish, and others each store history differently).
Clearing the screen in different terminal applications
The clear command works in almost every terminal application on Mac and Linux: Terminal, iTerm2, Konsole, GNOME Terminal, and others. On Windows, it works in PowerShell and Windows Terminal, which are the modern terminals Microsoft recommends.
If you're using the old Command Prompt (cmd.exe) on Windows, use cls instead. You can tell which one you're using by looking at the window title — Command Prompt says "Command Prompt", while PowerShell says "PowerShell" or "Windows PowerShell".
Some specialized terminal applications have their own clear commands or buttons, but clear is the standard across nearly all of them. If you're ever unsure, try clear first — it almost always works.
Keyboard shortcuts as an alternative
If you prefer not to type, most terminals let you clear the screen with a keyboard shortcut. On Mac and Linux, Ctrl+L clears the screen instantly without needing to press Enter. This is faster once you get used to it.
On Windows PowerShell and Windows Terminal, Ctrl+L also works. In the old Command Prompt, there is no standard keyboard shortcut — you have to type cls.
Some terminal applications let you customize keyboard shortcuts in their settings, so if you use your terminal frequently, you might want to check whether your application supports custom shortcuts. But the defaults are usually fast enough for most people.
Clearing the screen versus closing the terminal
Clearing the screen and closing the terminal are two different things. When you clear the screen, your terminal stays open and you can keep working. When you close the terminal, the window shuts down and you lose your current session.
If you close the terminal without saving your work, any unsaved files or incomplete commands are lost. Clearing the screen has no such risk — it's safe to do anytime, and you can always scroll up to see what you cleared.
Some people close and reopen their terminal when they want a completely fresh start, especially if they've been working for a long time and want to clear out memory or reset their environment. But for everyday use, clear is usually all you need.
Frequently Asked Questions
Does clear delete my files or commands?
No. clear only removes the text from your screen display. Your files, your command history, and everything else on your computer stays exactly as it was. You can scroll up in most terminals to see the commands you ran before you cleared the screen.
What if clear doesn't work?
Try cls instead — it's the Windows equivalent. If you're on Mac or Linux and clear doesn't work, you might be using an unusual shell or terminal configuration. Try the keyboard shortcut Ctrl+L instead, or check your terminal's help menu to see if it has a different command.
Can I clear the screen automatically when I open my terminal?
Yes, but it requires editing your shell configuration file (like .bashrc or .zshrc on Mac and Linux). Add the line clear to the file, and your terminal will run it every time you open a new session. This is optional and not necessary for most users.
Is there a way to clear only part of the screen?
The clear command clears the entire visible screen. There's no built-in command to clear only a portion of it. If you want to hide specific output, you can scroll down to move it out of view, or you can close and reopen your terminal.