Today’s article will be a nice and easy article, where we learn how to clear the terminal. That is, we will clear any typed text and returned information from the terminal. This will be a nice and quick article.
I am feeling like garbage today and I still need to edit the last article. Ugh… But, the show must go on!
This is what I get for not having scheduled a few articles ahead. Fortunately, I have short articles in mind. Today is a good day for just that.
It should be noted that clearing the screen doesn’t delete your scrollback history. Someone could come along and use the up arrow to see your previously typed commands. If you’re at your workstation then I guess you could consider this a privacy measure – but it certainly shouldn’t be considered much of a security measure.
So, as I said, it’ll be a short article. Let’s just jump into it…
Clear The Terminal:
This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press
Now, let’s generate some content… Run the following:
1 | ls && uptime |
That should fill up your terminal with stuff. Now, let’s clear the terminal. Type the following command:
1 | clear |
Tada!
But wait, there’s more!
Run those commands again. This time, and this appears to be pretty universal, just use your keyboard and press
See? It does the same thing as you get when you type clear
. Those are two ways for you to use when you want to clear the terminal.
Closure:
Yup… You’ve learned how to clear the terminal. I told you that it’d be a short article. It’s even an easy article. Now I’m going to lie down and hope for a nap.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.
The difference between `clear` and CONTROL+L is that `clear` overwries the last command’s exit code (`$?`) with its own, 0, whereas CONTROL+L doesn’t –it is not a command, but a terminal emulator shortcut.
Nice. I only knew that they both cleared the screen.