DEV Community

loading...
Cover image for  6 Commands to Clear Linux Terminal

6 Commands to Clear Linux Terminal

rich1n profile image Richard Rodrigues ・1 min read

Sometimes, as you running commands on a Linux terminal, you may feel that the terminal is 'filled up' with commands, text line and outputs and you may want to clear the terminal to declutter it and continue from the shining and clear top.

In this tutorial, we are going to explain how you can clear the Linux terminal.

Clear Command

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

Run the clear at the bottom of the terminal prompt.

$ clear

clear command

$ clear && clear

clear command

Results

The terminal screen gets cleared as shown below

clean

Reset Command

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

$ reset

reset

Ctrl + L Shortcut

The combination of ctrl+L will have the same effect as the clear or reset command.

printf "\033c" Command

$ printf "\033c"

printf

Clear the Linux Terminal (KDE Only)

KDE terminal (Konsole) the following command to clear the console:

  • clear && echo -en "\e[3J"
  • ctrl + shift + k

Clear the Linux Terminal (GNOME)

For a GNOME terminal (like Ubuntu 20.04) you can add keyboard shortcuts as shown

  • Shift + ctrl + alt + c

Did you like this article?

Comment your best Linux "clean screen" command

Discussion (5)

pic
Editor guide
Collapse
moopet profile image
Ben Sinclair

ctrl-l is bound to the same sequence as printf "\033c" I believe.
reset has other effects, such as setting the foreground and background colours and effects back to their default and stopping interpretation of any flow control or OOB commands.
What's the benefit from clear && clear?

Collapse
aslasn profile image
Ande

Tbh I was expecting a clear && clear && clear

Collapse
waylonwalker profile image
Waylon Walker
clear  && clear  && reset
Enter fullscreen mode Exit fullscreen mode
Collapse
haxnet profile image
HaxNet

Ctrl + L

And I just alias cclear = "clear && clear" this is so you don't have to cd ..

I think you should put out a new screenshot showing that the terminal pwd is in several sub folders deep and then use the command.

Collapse
waylonwalker profile image
Waylon Walker

I use clear all the time, and sometimes reset