6 Commands to Clear Linux Terminal

Sometimes, as you go about running commands on a Linux terminal, you may feel that the terminal is somewhat 'filled up' with commands and outputs of those commands. Therefore, you may want to clear the terminal to declutter it and continue from the top once more. In this article, we are going to outline how you can clear the Linux terminal.

1) clear command

Let's assume that your terminal is full of commands and output as shown below

clear the Linux terminal

Run the clear at the bottom of the terminal prompt.

Results

The terminal screen gets cleared as shown below

clear the Linux terminal

 

2) reset command

Just as in the example above, you need to run reset command at the bottom of the terminal to clear the screen as shown.

clear the Linux terminal

Results

As shown below, the terminal has been re-initialized by the reset command.

clear the Linux terminal

There's also the tput reset command which will also do the trick.

3) Using the Ctrl + L shortcut

Another Handy method of clearing the terminal is the use of ctrl+L keyboard shortcut. It will have the same effect as the clear or reset command.

4) Using the printf "\033c" command

Another method one can use is by typing printf "\033c" on the terminal prompt and hitting enter. This will also have the same effect of reinitilaizing the screen.
This can also be defined as an alias through

alias cls='printf "\033c"'

5) Clearing the Linux terminal for KDE

For a KDE terminal also referred to as Konsole, the following command comes in handy

clear && echo -en "\e[3J"

This can also be aliased as shown

alias cls='clear && echo -en "\e[3J"'

Furthermore, you can use the keyboard shortcut when dealing with Yakauke

ctrl + shift + k

6) Clearing the Linux terminal for GNOME - Ubuntu 18.04

For a GNOME terminal, like you would find in Ubuntu 18.04, you can add keyboard shortcuts as shown

Shift + ctrl + alt + c

clear Linux terminal
NOTE!

When using the above-mentioned methods to clear the screen, you'll notice that the screen (putty) is still scrollable. That is one call still scroll up using a mouse or cursor up key to the previous commands and their output. If you want to clear the screen without a scrollback use the command clear && clear . i.e.

clear && clear

Read Also :

In this article, we have shown how you can clear the Linux terminal. you are welcome to try out the commands outlined and provide feedback. Thank you.

Jamie Arthur 2:16 am

About Jamie Arthur

Hey, I'm James, a passionate Linux Systems administrator, and a tech enthusiast. I derive immense gratification in conducting research on Linux systems and keeping myself up to date with the latest in the technology world.

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.