Clear Screen
What is Clear Screen?
Clear Screen: Wipe the terminal screen, keeping the current command line intact. Clearing the terminal removes old output from the screen so you can start fresh. Ctrl+L works in most shells and keeps the command you were typing. The clear command does the same. In the macOS Terminal and iTerm, Cmd+K also clears the scrollback.
Frequently asked questions about Clear Screen
How is Clear Screen used in practice?
It is a small habit that helps when debugging. Clear the screen, run the command again, and everything you see belongs to this run. You no longer mix up an old error with a new one.
What should you keep in mind with Clear Screen?
Clearing only affects what is shown. It does not undo anything or affect running processes. If you need to keep the output, for example to share an error, copy it or redirect it to a file before you clear. Some terminals keep the scrollback even after clear, which is handy when you cleared too soon.
At a glance
| Category | Keyboard shortcuts |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |