Categories: Ubuntu

How to Clear Terminal in Ubuntu

Working with terminal regularly? Often, you may find yourself staring at a screen full of texts and symbols. For specific tasks, it’s inevitable. For the most part, however, it becomes really distracting. Keeping the terminal window clean and tidy is key to an efficient and comfortable experience.

In this guide, check out how to clear the terminal on Ubuntu.

Terminal on Ubuntu

By default, Ubuntu uses GNOME Terminal as the default terminal emulator. It’s a part of the GNOME desktop. Besides the default one, you should check out the best terminal emulators for Linux.

Launch “Terminal.”

Sponsored

What would the terminal window look like with tons of unnecessary outputs? It’s very simple to generate one using the “yes” command.

$ yes, the quick brown fox jumps over the lazy dog

Don’t forget to press “Ctrl + C” to stop the output. Otherwise, it will continue printing.

Clearing terminal

Now that we got all that unnecessary texts, time to clean it up. The simplest way is to use the “clear” command.

$ clear

Sponsored

This is the standard method of clearing the terminal window. There are definitely other methods. However, it may vary based on the terminal emulator you’re using. For example, if you’re using Putty, then running the clear command will clear just for a single page.

Instead of typing the command, we can also send the clear command to the terminal emulator using “Ctrl + L.” Some terminal emulators may have a different keyboard shortcut, for example, “Ctrl + Shift + K.”

Terminal reset

The clear command will clear the terminal screen of the outputs. It’s possible to re-initialize the terminal. It will remove all the temporary command history and reload all the terminal configurations. Note that it may also remove any temporary changes to environment variables.

To reset the terminal, run the reset command.

$ reset

It may take a few moments to re-initialize the terminal. The reset command is recommended to use only when it’s necessary. Otherwise, the clear command is the safe option.

There’s another more complicated way of doing so. We can set an alias to send a reset command to the terminal. Learn more about bash aliases. Unlike the reset command, however, this one does so a bit differently.

Here, cls will be the alias for the command printf “

Ubuntu Server Admin

Recent Posts

What our users make with Ubuntu Pro – Episode 2

How Vaultara achieved FedRAMP compliance with Ubuntu Pro Ubuntu Pro helps businesses worldwide to innovate…

15 hours ago

How To Install Zabbix Server 7.4 On Ubuntu 22.04

Zabbix is smart monitoring system on your network. This software written by php mysql. So…

21 hours ago

How To Install Zabbix Server 7.2 On Ubuntu 22.04

Zabbix is smart monitoring system on your network. This software written by php mysql. So…

22 hours ago

SuperTuxKart 1.5 RC2 added GUI option to Choose Vulkan or DirectX 9

SuperTuxKart, the 3D kart racing game, announced the second release candidate for the next 1.5…

22 hours ago

What’s the state of open source adoption in Europe?

New research suggests 86% of European organizations believe open source is valuable for the future…

2 days ago

What are dependencies, and how do you secure them?

Open source software is everywhere. Research shows that around 97% of codebases contain open source…

2 days ago