Clear the Terminal Screen (Ctrl+L)
Press Ctrl+L to clear the screen and move the prompt to the top — it keeps whatever you were typing. Same key in bash and zsh on Mac, Linux and WSL; equivalent to the clear command.
| Action | Mac | Windows | |
|---|---|---|---|
| Clear screen (keep line) | Ctrl+L | Ctrl+L | |
| Clear screen (command) | clear + Enter | clear + Enter | |
| Clear scrollback (macOS Terminal) | ⌘K | — | |
| Scroll up / down | ⇧PgUp / ⇧PgDn | ⇧PgUp / ⇧PgDn | |
| Reset a broken terminal | reset + Enter | reset + Enter |
Clear the screen, keep your command
Press Ctrl+L to clear the terminal and put the prompt at the top of the window. Unlike typing clear, it preserves anything you were already typing on the line. It behaves the same in bash and zsh on macOS Terminal, Linux and Windows WSL / Git Bash.
Ctrl+L vs clear vs ⌘K
Ctrl+L and the clear command only scroll the visible content out of view — you can still scroll back up. On macOS Terminal, ⌘K actually erases the scrollback buffer so you cannot scroll back. To fully reset a terminal whose output is garbled (after cat-ing a binary file), run reset.
Inside tmux or vim
Inside tmux, Ctrl+L still clears the active pane's shell. Inside vim, Ctrl+L redraws the screen rather than clearing it — that is vim's own behaviour, not the shell's.
FAQ
How do I clear the terminal screen with a shortcut?
Press Ctrl+L. It clears the screen and moves the prompt to the top while keeping anything you were typing.
What is the difference between Ctrl+L and the clear command?
Both clear the visible screen, but Ctrl+L keeps your current input line, while typing clear submits a command. Neither erases scrollback.
How do I clear the scrollback on macOS Terminal?
Press ⌘K to erase the scrollback buffer so you can no longer scroll up. Ctrl+L only scrolls content out of view.
Does Ctrl+L work in Windows WSL?
Yes. In bash/zsh under WSL or Git Bash, Ctrl+L clears the screen just like on macOS and Linux.