14 C
Jaipur
Sunday, November 22, 2020

How to Clear Terminal Screen in Ubuntu and Other Linux

Must read

UFC 255 live stream: how to watch Figueiredo vs Perez online from anywhere tonight

Brazil’s Deiveson Figueiredo will be looking to solidify his status as one of MMA’s big guns, with the first defence of his flyweight title taking place this...

Google almost made me change my mind about using a Chromebook for business – except for one thing

In the current climate, getting the right hardware to work from home effectively is vital. Having the correct laptop, monitor and accessories can massively...

Black Friday Preview: the all-new Ring Doorbell hits lowest sale price ever

Black Friday officially less than a week away, but Amazon is giving us a preview of the sales event with fantastic device deals that...

The 10 best Amazon Black Friday deals: 4K TVs, Ring Doorbell, Kindle, and more

Amazon Black Friday deals have arrived early this year with record-low prices on 4K TVs, the Ring Doorbell, Kindle, Fire TV devices, and more....

When you are working in the terminal, often you’ll find that your terminal screen is filled up with too many commands and their outputs.

You may want to clear the terminal to declutter the screen and focus on the next task you are going to perform. Clearing the Linux terminal screen helps a lot, trust me.

Clear Linux terminal with clear command

So, how do you clear terminal in Linux? The simplest and the most common way is to use the clear command:

clear

You need no option with the clear command. It’s that simple but there are some additional things you need to know about it.

The clear command and other methods of clearing screen may depend on the terminal emulator you are using. Terminal emulator is the terminal application that you use for accessing the Linux shell (command line).

If you use clear command on Ubuntu with GNOME Terminal, it will clear the screen and you won’t be able to see what else you had on the screen previously.

In many other terminal emulators or Putty, it may just clear the screen for one page. If you scroll with mouse or PageUp and PageDown keys, you can still access the old screen outputs.

Frankly, it depends on your need. If you suddenly realize that you need to refer to the output of a previously run command, perhaps having that option available will be helpful.

Other ways to clear terminal screen in Linux

Clear Terminal Screen Linux

Clear command is not the only way to clear the terminal screen.

You can use Ctrl+L keyboard shortcut in Linux to clear the screen. It works in most terminal emulators.

Ctrl+L

If you use Ctrl+L and clear command in GNOME terminal (default in Ubuntu), you’ll notice the difference between their impact. Ctrl+L moves the screen one page down giving the illusion of a clean screen but you can still access the command output history by scrolling up.

Some other terminal emulators have this keyboard shortcut set at Ctrl+Shift+K.

You can also use reset command for clearing the terminal screen. Actually, this command performs a complete terminal re-initialization. It could take a bit longer than clear command, though.

reset

There are a couple of other complicated ways to clear the screen when you want to clear the screen completely. But since the command is a bit complicated, it’s better to use it as alias in Linux:

alias cls="printf "33c""

You can add this alias to your bash profile so that it is available as command.

I know this was a pretty basic topic and most Linux users probably already knew it but it doesn’t harm in covering the elementary topics for the new Linux users. Isn’t it?

Got some secretive tip on clearing terminal screen? Why not share it with us?

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

UFC 255 live stream: how to watch Figueiredo vs Perez online from anywhere tonight

Brazil’s Deiveson Figueiredo will be looking to solidify his status as one of MMA’s big guns, with the first defence of his flyweight title taking place this...

Google almost made me change my mind about using a Chromebook for business – except for one thing

In the current climate, getting the right hardware to work from home effectively is vital. Having the correct laptop, monitor and accessories can massively...

Black Friday Preview: the all-new Ring Doorbell hits lowest sale price ever

Black Friday officially less than a week away, but Amazon is giving us a preview of the sales event with fantastic device deals that...

The 10 best Amazon Black Friday deals: 4K TVs, Ring Doorbell, Kindle, and more

Amazon Black Friday deals have arrived early this year with record-low prices on 4K TVs, the Ring Doorbell, Kindle, Fire TV devices, and more....

Google Nest Mini and Amazon Echo Dot lead Argos Black Friday deals with massive price cuts

If you're after a cheap smart speaker in this year's Black Friday and Cyber Monday deals, Argos may have you sorted. There are plenty...