How to Clear Screen in Linux

0

Linux is full of commands that allow you to achieve every task with numerous commands. Having these text-based commands is handy; you can unleash the full potential of your Linux system. Moreover, the terminal is the most popular command line interface (CLI) for executing these commands.

While working in the terminal, the screen gets cluttered with various commands and their outputs. Hence, erasing everything from the terminal window is a basic yet essential task for users, especially those unfamiliar with the CLI. In this short article, we have included various methods to clear the screen in Linux

Clearing the screen is fundamental whether working in the terminal or accessing any remote server via SSH. There are three ways for it, so let’s take a look at all of them:

The clear Command

The clear is the most straightforward method to wipe the screen: 

clear-command-in-linux

After executing the command, the system will immediately clear the terminal window, giving you a blank screen.

blank-screen-of-terminal-in-linuxblank-screen-of-terminal-in-linux

The Keyboard Shortcut

If you prefer keyboard shortcuts over commands, use CTRL+L. Unlike the clear command, this shortcut does not delete any contents of your current terminal window. Instead, it scrolls down the window to make it appear like the screen has been cleared. For example:

keyboard-keyboard-shortcut-to-clear-screen-in-linuxkeyboard-keyboard-shortcut-to-clear-screen-in-linux

Now, press CTRL+L.

blank-screen-of-terminal-in-linuxblank-screen-of-terminal-in-linux

The ANSI Escape Sequences- Advanced Method

Advanced users or those proficient in terminal interactions can also use ANSI escape sequences to clear the screen. The escape sequence for this is ‘

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More