Clear! (clear your terminal screen)

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
10,580
Reaction score
9,107
Credits
87,870
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.
 


C

CrazedNerd

Guest
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.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
10,580
Reaction score
9,107
Credits
87,870
Change the history. You can make your terminal history infinite lines. For example, using xfce4-terminal:

7HPhEdG.png
 

BigBadBeef

Active Member
Joined
Sep 23, 2021
Messages
437
Reaction score
219
Credits
3,962
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!
 

sphen

Well-Known Member
Joined
Dec 12, 2022
Messages
868
Reaction score
751
Credits
10,394
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
 

wendy-lebaron

Active Member
Joined
May 3, 2023
Messages
433
Reaction score
139
Credits
5,790
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:

jerry2050

New Member
Joined
Jul 11, 2020
Messages
2
Reaction score
0
Credits
10
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
 

Members online


Top