Clear! (clear your terminal screen)

I've been using linux and the command line since the late 1990s, and I never knew about the Ctrl-l. Thank you! :)

From here:


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.

So, there's what's going on. Someone left it as a comment when I wrote a similar article. I knew that it was a shortcut, but didn't really know what clear was doing.
 


Something i've been wondering: is there a way to be able to scroll upward if you produced a monstrous input? There's usually a cutoff point after a certain number of lines (probably a few thousand). I would think some shell variable controls this, or maybe just configuring the gnome-terminal itself.
 
Change the history. You can make your terminal history infinite lines. For example, using xfce4-terminal:

7HPhEdG.png
 
Whenever I clear the terminal, I use it to conceal my own criminal incompetence. Sometimes its downright painful to look at, even if I was the one who typed it out!
 
Whenever I clear the terminal, I use it to conceal my own criminal incompetence. Sometimes its downright painful to look at, even if I was the one who typed it out!
Remember to clear the history, too. It is useful to know, so you can be sure to hide the evidence! ;-)

history -c
 
Most of these replies in my experience. But on KDE, Konsole has CTRL+SHIFT+K which is like clear command. If I don't have to type five letters then ENTER key then I won't. :)

I don't need to blitz my history, I just want a clear screen without any funny scrollbar business.

EDIT: my apologies to anyone who read this message before it was edited. Have checked, currently on Manjaro KDE. Have to hold two modifier keys not just "control".
 
Last edited:
When you're typing a lot in a terminal and want to clear the screen quickly, you can do so easily a couple different ways.

The one most people know about:
Code:
clear

Yeah, simply type 'clear'.

The one you'll use a lot more:
Code:
ctrl + l
(hit the ctrl key, then a lowercase L)

It doesn't make everything go away, you can actually see everything if you scroll up, but its very handy and I can't tell you how many times I use it each day.

(really - I can't tell you, because when you type 'clear' you'll see it in your history, but if you use ctrl-l, it doesn't make it into history)
Ctrl + l is simply fast. Thanks
 


Top