How to Clear Your Linux Terminal Screen Completely

When you are deeply engrossed in compiling source code or tailing a massive server log file, your Linux terminal can quickly become cluttered with hundreds of lines of text. Trying to find the exact output of your most recent command amidst the wall of historical data is frustrating and visually overwhelming.

To restore a clean workspace, you need to clear the terminal screen. However, there are two different ways to do this: a soft visual reset and a hard memory flush.

Method 1: The Standard Clear Command (Soft Reset)

The most common method for cleaning up the terminal interface is using the built-in clear utility.

  1. When your terminal is cluttered, ensure your cursor is active at the bottom prompt.
  2. Type the following command:
    clear
  3. Press Enter.

The screen will instantly go completely blank, and your prompt will return to the very top-left corner of the window.

The Keyboard Shortcut: You can achieve this exact same soft reset much faster without typing anything. Simply press Ctrl + L on your keyboard. This is a nearly universal shortcut that works in Bash, Zsh, and most other modern Linux shells.

Note: This is a “soft” reset. The text has not actually been deleted. The terminal emulator simply pushed all the old text upward. If you use your mouse scroll wheel to scroll up, you will see all of your previous output is still perfectly intact in the buffer memory.

Method 2: The Reset Command (Hard Flush)

If you want to absolutely eradicate the scrollback buffer—meaning no one can scroll up with a mouse to see the sensitive server data or API keys you just printed to the screen—you must perform a hard terminal reset.

  1. Type the following command:
    reset
  2. Press Enter.

The terminal will freeze for a brief second as it re-initializes the entire terminal emulator session. It will flush the graphical buffer memory entirely. When the prompt returns to the top of the screen, you will not be able to scroll up. The history of that window’s output is permanently gone.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.